-
Notifications
You must be signed in to change notification settings - Fork 527
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
Smarty filter doesn't convert straight single quote into curly single quote #57
Comments
I’m seeing the same thing. When using The following minimal test case class TestRenderer < Redcarpet::Render::HTML
include(Redcarpet::Render::SmartyPants)
end
Redcarpet::Markdown.new(TestRenderer).render(%q(This "works" but this doesn't.)) for me produces
The following Redcarpet::Render::SmartyPants.render(%q(This "works" but this doesn't.)) however correctly produces
I cursorily tried to track down the problem but don’t immediately see where the |
I use this as a temporary fix. markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML)
html = markdown.render content
html.gsub!("'", "'")
html = Redcarpet::Render::SmartyPants.render html |
This doesn't seem to have been fixed for the 2.0.0 release. Or am I mistaken? (I'm curious because I want to update nanoc's Redcarpet support, and I want to make sure that SmartyPants rendering still works.) |
Yup, it’s still broken for me in 2.0.0. |
This is still an issue. Is there any plan to fix it or is it now Expected Behaviour™? |
+1 vote to fix this |
My workaround was to completely write my own SmartyPants replacement set of gsubs, which are less smart because they rely on me using backtick characters like LaTeX/Markdown, but I think I prefer it that way, since AFAIK, there isn't actually a way to programmatically predict all the crazy ways English can use curly quotes, and I was having specific problems, like the curly quote being the wrong way around when abbreviating the front of a word, like 'round instead of around. https://github.com/puyo/poetry.gregorymcintyre.com/blob/master/lib/ensmarten.rb |
+1 to fixing this. @vmg, any news on this / #53 / #66? The temporary fix above isn't great for me, since there's a custom renderer. @mmorearty seems to have added a possible fix with his referencing commit. Just to repeat @steverandy: Redcarpet::Markdown.new(Redcarpet::Render::SmartyHTML).render(%q{This "works" but this doesn't"})
# => "<p>This “works” but this doesn't"</p>\n"
#
# note the ' And yet, using Redcarpet::Render::SmartyPants.render(%q{This "works" but this doesn't"})
# => "This “works” but this doesn’t""
#
# note the ’ where ' was above I'd like to see both behaving the way |
The fix seems to be in #200 as a pull request. |
This is needed because of a bug in vmg/redcarpet#57. There is a test assertion in test_helper to verify that this is actually necessary, and the condition means it will automatically turn off should redcarpet have this bug fixed for the user.
In the release of b5, the Smarty filter doesn't convert straight single quote into curly single quote.
It was working properly in b4.
The text was updated successfully, but these errors were encountered: