-
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
Fix issue of UTF-8 belows the autolinked email address. #463
base: master
Are you sure you want to change the base?
Conversation
@vmg - Any chance of seeing this merged? #388 is biting me pretty hard, and and this PR fixes that bug. Reproduce: renderer = Redcarpet::Render::HTML.new(with_toc_data: true)
md = Redcarpet::Markdown.new(renderer, no_intra_emphasis: true, tables: true, autolink: true, quote: true)
md.render("“[email protected]“")
# => "<p>“<a href=\"mailto:[email protected]%E2\">[email protected]\xE2</a>\x80\x9C</p>\n"
# irb(main):008:0> md.render("“[email protected]“").valid_encoding?
# => false As you can see, the first quote is rendered properly but the second is not. |
maybe ping @robin850 ...? |
test/markdown_test.rb
Outdated
@@ -126,6 +126,12 @@ def test_whitespace_after_urls | |||
assert_equal exp, rd | |||
end | |||
|
|||
def test_auto_linked_email_utf8_issue | |||
rd = render_with({ autolink: true }, "[email protected]」\[email protected]ü") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part fails on the latest source at 03b664d. So it should be:
rd = render("[email protected]」\n[email protected]ü", with: [:autolink])
exp = %{<p><a href="mailto:[email protected]">[email protected]</a>」\n<a href="mailto:[email protected]">[email protected]</a>ü</p>}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OMG this project is still alive!!
Got it, I will rebase this PR soon. Thanks for reviewing. :)
See vmg#388 for more details.
See #388 for more details.