summaryrefslogtreecommitdiffstats
path: root/lib/redcloth3.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-12-30 16:23:05 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-12-30 16:23:05 +0000
commit8b7fb7213f0ea06523dbc16723f09f4247084872 (patch)
tree68d76927addf0c71b07795a3f9b105e8c639142a /lib/redcloth3.rb
parent421539e3be392d6ecd0e4fc252e8d76662ee2a81 (diff)
downloadredmine-8b7fb7213f0ea06523dbc16723f09f4247084872.tar.gz
redmine-8b7fb7213f0ea06523dbc16723f09f4247084872.zip
Stricter textile links parsing (#2417).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2212 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redcloth3.rb')
-rw-r--r--lib/redcloth3.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/redcloth3.rb b/lib/redcloth3.rb
index ae17f6760..c138450a2 100644
--- a/lib/redcloth3.rb
+++ b/lib/redcloth3.rb
@@ -791,7 +791,10 @@ class RedCloth3 < String
\s?
(?:\(([^)]+?)\)(?="))? # $title
":
- ([\w\/]\S+?) # $url
+ ( # $url
+ (\/|https?:\/\/|s?ftps?:\/\/|www\.)
+ [\w\/]\S+?
+ )
(\/)? # $slash
([^\w\=\/;\(\)]*?) # $post
(?=<|\s|$)
@@ -799,7 +802,7 @@ class RedCloth3 < String
#"
def inline_textile_link( text )
text.gsub!( LINK_RE ) do |m|
- pre,atts,text,title,url,slash,post = $~[1..7]
+ pre,atts,text,title,url,proto,slash,post = $~[1..8]
url, url_title = check_refs( url )
title ||= url_title