Skip to content
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

Support possible German umlauts in email address strings #88

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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/rinku/autolink.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ autolink__email(
if (rinku_isalnum(c))
continue;

if (strchr(".+-_%", c) != NULL)
if (strchr(".+-_%äöüß", c) != NULL)
continue;

break;
Expand Down
5 changes: 5 additions & 0 deletions test/autolink_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ def test_terminates_on_ampersand
assert_linked "hello &#39;<a href=\"#{url}\">#{url}</a>&#39; hello", "hello &#39;#{url}&#39; hello"
end

def test_auto_link_email_can_handle_international_accepted_characters
address = "björn-jürgen.nuß[email protected]"
assert_linked "<a href=\"mailto:#{address}\">#{address}</a>", address
end

def test_does_not_segfault
assert_linked "< this is just a test", "< this is just a test"
end
Expand Down