No multiline text for textile links.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1463 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
54138d2b17
commit
aa87a73e41
@ -764,7 +764,7 @@ class RedCloth < String
|
|||||||
([\s\[{(]|[#{PUNCT}])? # $pre
|
([\s\[{(]|[#{PUNCT}])? # $pre
|
||||||
" # start
|
" # start
|
||||||
(#{C}) # $atts
|
(#{C}) # $atts
|
||||||
([^"]+?) # $text
|
([^"\n]+?) # $text
|
||||||
\s?
|
\s?
|
||||||
(?:\(([^)]+?)\)(?="))? # $title
|
(?:\(([^)]+?)\)(?="))? # $title
|
||||||
":
|
":
|
||||||
|
@ -45,7 +45,7 @@ module Redmine
|
|||||||
# Patch for RedCloth. Fixed in RedCloth r128 but _why hasn't released it yet.
|
# Patch for RedCloth. Fixed in RedCloth r128 but _why hasn't released it yet.
|
||||||
# <a href="http://code.whytheluckystiff.net/redcloth/changeset/128">http://code.whytheluckystiff.net/redcloth/changeset/128</a>
|
# <a href="http://code.whytheluckystiff.net/redcloth/changeset/128">http://code.whytheluckystiff.net/redcloth/changeset/128</a>
|
||||||
def hard_break( text )
|
def hard_break( text )
|
||||||
text.gsub!( /(.)\n(?!\n|\Z| *([#*=]+(\s|$)|[{|]))/, "\\1<br />" ) if hard_breaks
|
text.gsub!( /(.)\n(?!\n|\Z| *([#*=]+(\s|$)|[{|]))/, "\\1<br />\n" ) if hard_breaks
|
||||||
end
|
end
|
||||||
|
|
||||||
# Patch to add code highlighting support to RedCloth
|
# Patch to add code highlighting support to RedCloth
|
||||||
|
@ -58,7 +58,9 @@ class ApplicationHelperTest < HelperTestCase
|
|||||||
to_test = {
|
to_test = {
|
||||||
'This is a "link":http://foo.bar' => 'This is a <a href="http://foo.bar" class="external">link</a>',
|
'This is a "link":http://foo.bar' => 'This is a <a href="http://foo.bar" class="external">link</a>',
|
||||||
'This is an intern "link":/foo/bar' => 'This is an intern <a href="/foo/bar">link</a>',
|
'This is an intern "link":/foo/bar' => 'This is an intern <a href="/foo/bar">link</a>',
|
||||||
'"link (Link title)":http://foo.bar' => '<a href="http://foo.bar" title="Link title" class="external">link</a>'
|
'"link (Link title)":http://foo.bar' => '<a href="http://foo.bar" title="Link title" class="external">link</a>',
|
||||||
|
# no multiline link text
|
||||||
|
"This is a double quote \"on the first line\nand another on a second line\":test" => "This is a double quote \"on the first line<br />\nand another on a second line\":test"
|
||||||
}
|
}
|
||||||
to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) }
|
to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) }
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user