summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-05-10 07:20:27 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-05-10 07:20:27 +0000
commitb8811f47ccf554895b1b48be3f881dc74b4fc3dd (patch)
treecacad64644b4e210ad17c9686182cb94a600e5ee
parent010945b3d8f98abfd99c5e6c3a1273da327af870 (diff)
downloadredmine-b8811f47ccf554895b1b48be3f881dc74b4fc3dd.tar.gz
redmine-b8811f47ccf554895b1b48be3f881dc74b4fc3dd.zip
Merged r14237 (#19735).
git-svn-id: http://svn.redmine.org/redmine/branches/3.0-stable@14248 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--lib/redmine/wiki_formatting.rb2
-rw-r--r--test/unit/lib/redmine/wiki_formatting_test.rb6
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/redmine/wiki_formatting.rb b/lib/redmine/wiki_formatting.rb
index 4ea59336d..c4e4bb7c3 100644
--- a/lib/redmine/wiki_formatting.rb
+++ b/lib/redmine/wiki_formatting.rb
@@ -135,7 +135,7 @@ module Redmine
# Destructively replaces email addresses into clickable links
def auto_mailto!(text)
- text.gsub!(/([\w\.!#\$%\-+.]+@[A-Za-z0-9\-]+(\.[A-Za-z0-9\-]+)+)/) do
+ text.gsub!(/([\w\.!#\$%\-+.\/]+@[A-Za-z0-9\-]+(\.[A-Za-z0-9\-]+)+)/) do
mail = $1
if text.match(/<a\b[^>]*>(.*)(#{Regexp.escape(mail)})(.*)<\/a>/)
mail
diff --git a/test/unit/lib/redmine/wiki_formatting_test.rb b/test/unit/lib/redmine/wiki_formatting_test.rb
index 413905db9..cd7f40e73 100644
--- a/test/unit/lib/redmine/wiki_formatting_test.rb
+++ b/test/unit/lib/redmine/wiki_formatting_test.rb
@@ -48,6 +48,12 @@ EXPECTED
assert_equal expected.gsub(%r{[\r\n\t]}, ''), Redmine::WikiFormatting::NullFormatter::Formatter.new(raw).to_html.gsub(%r{[\r\n\t]}, '')
end
+ def test_should_link_email_with_slashes
+ raw = 'foo/bar@example.net'
+ expected = '<p><a class="email" href="mailto:foo/bar@example.net">foo/bar@example.net</a></p>'
+ assert_equal expected.gsub(%r{[\r\n\t]}, ''), Redmine::WikiFormatting::NullFormatter::Formatter.new(raw).to_html.gsub(%r{[\r\n\t]}, '')
+ end
+
def test_links_separated_with_line_break_should_link
raw = <<-DIFF
link: https://www.redmine.org