Skip to content

Commit

Permalink
Import fix vmg#463
Browse files Browse the repository at this point in the history
  • Loading branch information
kaorukobo committed Feb 18, 2022
2 parents 58dfb26 + 2be5906 commit 5691ae0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ext/redcarpet/autolink.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ sd_autolink__email(
for (link_end = 0; link_end < size; ++link_end) {
uint8_t c = data[link_end];

if (isalnum(c))
if (isalnum(c) && c < 0x7f)
continue;

if (c == '@')
Expand Down
6 changes: 6 additions & 0 deletions test/markdown_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@ def test_whitespace_after_urls
assert_equal expected, output
end

def test_auto_linked_email_utf8_issue
rd = render_with({ autolink: true }, "[email protected]\n[email protected]ü")
exp = %{<p><a href="mailto:[email protected]">[email protected]</a>」\n<a href="mailto:[email protected]">[email protected]</a>ü</p>\n}
assert_equal exp, rd
end

def test_memory_leak_when_parsing_char_links
render(<<-leaks.strip_heredoc)
2. Identify the wild-type cluster and determine all clusters
Expand Down

0 comments on commit 5691ae0

Please sign in to comment.