Project

General

Profile

Defect #1456 ยป wiki_formatting_links.patch

Wiki links patch - Pierre Paysant-Le Roux, 2008-06-16 00:05

View differences:

lib/redmine/wiki_formatting.rb (working copy)
end
end
end
# Turns all email addresses into clickable links (code from Rails).
def inline_auto_mailto(text)
text.gsub!(/([\w\.!#\$%\-+.]+@[A-Za-z0-9\-]+(\.[A-Za-z0-9\-]+)+)/) do
text = $1
%{<a href="mailto:#{$1}" class="email">#{text}</a>}
mail = $1
if text.match(/<a\b[^>]*>(.*)(#{Regexp.escape(mail)})(.*)<\/a>/)
mail
else
%{<a href="mailto:#{mail}" class="email">#{mail}</a>}
end
end
end
end
    (1-1/1)