summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/redcloth.rb4
-rw-r--r--lib/redmine/wiki_formatting.rb2
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/redcloth.rb b/lib/redcloth.rb
index e1a995da2..c4b504871 100644
--- a/lib/redcloth.rb
+++ b/lib/redcloth.rb
@@ -784,7 +784,9 @@ class RedCloth < String
atts << " title=\"#{ title }\"" if title
atts = shelve( atts ) if atts
- "#{ pre }<a#{ atts }>#{ text }</a>#{ post }"
+ external = (url =~ /^http:\/\//) ? ' class="external"' : ''
+
+ "#{ pre }<a#{ atts }#{ external }>#{ text }</a>#{ post }"
end
end
diff --git a/lib/redmine/wiki_formatting.rb b/lib/redmine/wiki_formatting.rb
index 6f2aea0ae..da04dd932 100644
--- a/lib/redmine/wiki_formatting.rb
+++ b/lib/redmine/wiki_formatting.rb
@@ -99,7 +99,7 @@ module Redmine
# and URL's prefixed with ! !> !< != (textile images)
all
else
- %(#{leading}<a href="#{proto=="www."?"http://www.":proto}#{url}">#{proto + url}</a>#{post})
+ %(#{leading}<a class="external" href="#{proto=="www."?"http://www.":proto}#{url}">#{proto + url}</a>#{post})
end
end
end