Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
output = render("a@b.c」\nd@example.coü", with: [:autolink])
expected = %{<p><a href="mailto:a@b.c">a@b.c</a>」\n<a href="mailto:d@example.co">d@example.co</a>ü</p>\n}
assert_equal expected, output
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