diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-06-07 20:10:57 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-06-07 20:10:57 +0000 |
commit | f902860955813645d70f669c3961ebd35d4ed9a1 (patch) | |
tree | 3a8cde2aed5aadcb4263d765bccea816f4ab2918 /lib/redmine/wiki_formatting.rb | |
parent | c513037c6edce0d039b2f6ab602be8a309e2b68c (diff) | |
download | redmine-f902860955813645d70f669c3961ebd35d4ed9a1.tar.gz redmine-f902860955813645d70f669c3961ebd35d4ed9a1.zip |
Link to user in wiki syntax (#4179).
Patch by Marius BALTEANU.
git-svn-id: http://svn.redmine.org/redmine/trunk@16636 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine/wiki_formatting.rb')
-rw-r--r-- | lib/redmine/wiki_formatting.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/redmine/wiki_formatting.rb b/lib/redmine/wiki_formatting.rb index 17348d16e..03129aa21 100644 --- a/lib/redmine/wiki_formatting.rb +++ b/lib/redmine/wiki_formatting.rb @@ -37,7 +37,7 @@ module Redmine args : %w(Formatter Helper HtmlParser).map {|m| "Redmine::WikiFormatting::#{name.classify}::#{m}".constantize rescue nil} - raise "A formatter class is required" if formatter.nil? + raise "A formatter class is required" if formatter.nil? @@formatters[name] = { :formatter => formatter, @@ -153,7 +153,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!(/((?<!@)\b[\w\.!#\$%\-+.\/]+@[A-Za-z0-9\-]+(\.[A-Za-z0-9\-]+)+)/) do mail = $1 if text.match(/<a\b[^>]*>(.*)(#{Regexp.escape(mail)})(.*)<\/a>/) mail @@ -161,7 +161,7 @@ module Redmine %(<a class="email" href="mailto:#{ERB::Util.html_escape mail}">#{ERB::Util.html_escape mail}</a>).html_safe end end - end + end end # Default formatter module |