Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escaping doesn't play well with smart quotes #375

Open
gpakosz opened this issue Oct 15, 2016 · 1 comment
Open

Escaping doesn't play well with smart quotes #375

gpakosz opened this issue Oct 15, 2016 · 1 comment

Comments

@gpakosz
Copy link

gpakosz commented Oct 15, 2016

irb(main):001:0> require 'kramdown'
=> true
irb(main):002:0> Kramdown::Document.new('"[foo]"', entity_output: 'numeric').to_html
=> "<p>&#8220;[foo]&#8221;</p>\n"

However, when I try to escape the brackets because I want to make sure Kramdown doesn't believe[foo] is a link tag, then I get the opening double quote gets replaced by a curly closing double quote:

irb(main):003:0> Kramdown::Document.new('"\[foo\]"', entity_output: 'numeric').to_html
=> "<p>&#8221;[foo]&#8221;</p>\n"
@gettalong
Copy link
Owner

This problem only occurs at the start of a paragraph, not when there is some text before the quote. I have looked at the code but there is no easy solution to this problem as far as I can see.

I have tried some things to get this to work while not introducing another problem but I didn't find a solution. So to work around this problem make sure there is something at the start of the line before the quote.

Pull requests are welcome!

@gettalong gettalong reopened this Nov 12, 2016
Repository owner deleted a comment Apr 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants