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

[SmartyPants] Incorrect single quote rendered around Markdown links #624

jgarber623 opened this issue Aug 5, 2017 · 2 comments · Fixed by #626, vdesabou/alfred-spotify-mini-player#480 or majacQ/circleci-docs#4 · May be fixed by juslee/java-buildpack#4 or tyrchen/clojure-system-book#2


Copy link

First off, thanks for the hard work on Redcarpet!

I've stumbled upon a weird bit of misbehavior related to Markdown links and SmartyPants that I couldn't find documented in any of the existing issues. I'm using Ruby 2.4.1 and Redcarpet 3.4.0 in a Rails 5.1 app. Details are below, but let me know if I can provide any additional examples or background.

Expected Behavior

I'd expect that a run of Markdown like…

[Jason]('s website

…when parsed with Redcarpet::Render::SmartyPants.render would return:

[Jason](’s website

Observed Behavior

If the ' is adjacent to the Markdown link code, an unexpected character entity (‘) is returned:

irb(main):011:0> Redcarpet::Render::SmartyPants.render("[Jason]('s website")
=> "[Jason](‘s website"

If the ' is moved within the anchor text, the expected character entity (’) is returned:

irb(main):012:0> Redcarpet::Render::SmartyPants.render("[Jason's website](")
=> "[Jason’s website]("

For completion's sake, surrounding the Markdown link code with single ' characters returns:

irb(main):013:0> Redcarpet::Render::SmartyPants.render("'[Jason]('s website")
=> "‘[Jason](’s website"
Copy link

robin850 commented Aug 9, 2017

This has been fixed and will be part of Redcarpet 3.5.0. Thanks for reporting ! :-)

Copy link

Thanks, @robin850!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment