summaryrefslogtreecommitdiffstats
path: root/lib/redcloth3.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/redcloth3.rb')
-rw-r--r--lib/redcloth3.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/redcloth3.rb b/lib/redcloth3.rb
index a4d33f804..e99ccdf77 100644
--- a/lib/redcloth3.rb
+++ b/lib/redcloth3.rb
@@ -784,6 +784,7 @@ class RedCloth3 < String
end
LINK_RE = /
+ (
([\s\[{(]|[#{PUNCT}])? # $pre
" # start
(#{C}) # $atts
@@ -797,13 +798,16 @@ class RedCloth3 < String
)
(\/)? # $slash
([^\w\=\/;\(\)]*?) # $post
+ )
(?=<|\s|$)
/x
#"
def inline_textile_link( text )
text.gsub!( LINK_RE ) do |m|
- pre,atts,text,title,url,proto,slash,post = $~[1..8]
-
+ all,pre,atts,text,title,url,proto,slash,post = $~[1..9]
+ if text.include?('<br />')
+ all
+ else
url, url_title = check_refs( url )
title ||= url_title
@@ -821,6 +825,7 @@ class RedCloth3 < String
external = (url =~ /^https?:\/\//) ? ' class="external"' : ''
"#{ pre }<a#{ atts }#{ external }>#{ text }</a>#{ post }"
+ end
end
end