Fix issue of UTF-8 belows the autolinked email address. - #463
Open
davy-tw wants to merge 1 commit into
Open
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("“foo@example.com“")
# => "<p>“<a href=\"mailto:foo@example.com%E2\">foo@example.com\xE2</a>\x80\x9C</p>\n"
# irb(main):008:0> md.render("“foo@example.com“").valid_encoding?
# => falseAs you can see, the first quote is rendered properly but the second is not. |
Author
|
maybe ping @robin850 ...? |
kaorukobo
added a commit
to kaorukobo/redcarpet
that referenced
this pull request
Feb 18, 2022
kaorukobo
reviewed
Feb 18, 2022
| end | ||
|
|
||
| def test_auto_linked_email_utf8_issue | ||
| rd = render_with({ autolink: true }, "a@b.c」\nd@example.coü") |
There was a problem hiding this comment.
This part fails on the latest source at 03b664d. So it should be:
rd = render("a@b.c」\nd@example.coü", with: [:autolink])
exp = %{<p><a href="mailto:a@b.c">a@b.c</a>」\n<a href="mailto:d@example.co">d@example.co</a>ü</p>}
Author
There was a problem hiding this comment.
OMG this project is still alive!!
Got it, I will rebase this PR soon. Thanks for reviewing. :)
See vmg#388 for more details.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See #388 for more details.