##// END OF EJS Templates
No multiline text for textile links....
Jean-Philippe Lang -
r1449:aa87a73e4130
parent child
Show More
@@ -764,7 +764,7 class RedCloth < String
764 ([\s\[{(]|[#{PUNCT}])? # $pre
764 ([\s\[{(]|[#{PUNCT}])? # $pre
765 " # start
765 " # start
766 (#{C}) # $atts
766 (#{C}) # $atts
767 ([^"]+?) # $text
767 ([^"\n]+?) # $text
768 \s?
768 \s?
769 (?:\(([^)]+?)\)(?="))? # $title
769 (?:\(([^)]+?)\)(?="))? # $title
770 ":
770 ":
@@ -45,7 +45,7 module Redmine
45 # Patch for RedCloth. Fixed in RedCloth r128 but _why hasn't released it yet.
45 # Patch for RedCloth. Fixed in RedCloth r128 but _why hasn't released it yet.
46 # <a href="http://code.whytheluckystiff.net/redcloth/changeset/128">http://code.whytheluckystiff.net/redcloth/changeset/128</a>
46 # <a href="http://code.whytheluckystiff.net/redcloth/changeset/128">http://code.whytheluckystiff.net/redcloth/changeset/128</a>
47 def hard_break( text )
47 def hard_break( text )
48 text.gsub!( /(.)\n(?!\n|\Z| *([#*=]+(\s|$)|[{|]))/, "\\1<br />" ) if hard_breaks
48 text.gsub!( /(.)\n(?!\n|\Z| *([#*=]+(\s|$)|[{|]))/, "\\1<br />\n" ) if hard_breaks
49 end
49 end
50
50
51 # Patch to add code highlighting support to RedCloth
51 # Patch to add code highlighting support to RedCloth
@@ -58,7 +58,9 class ApplicationHelperTest < HelperTestCase
58 to_test = {
58 to_test = {
59 'This is a "link":http://foo.bar' => 'This is a <a href="http://foo.bar" class="external">link</a>',
59 'This is a "link":http://foo.bar' => 'This is a <a href="http://foo.bar" class="external">link</a>',
60 'This is an intern "link":/foo/bar' => 'This is an intern <a href="/foo/bar">link</a>',
60 'This is an intern "link":/foo/bar' => 'This is an intern <a href="/foo/bar">link</a>',
61 '"link (Link title)":http://foo.bar' => '<a href="http://foo.bar" title="Link title" class="external">link</a>'
61 '"link (Link title)":http://foo.bar' => '<a href="http://foo.bar" title="Link title" class="external">link</a>',
62 # no multiline link text
63 "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"
62 }
64 }
63 to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) }
65 to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) }
64 end
66 end
General Comments 0
You need to be logged in to leave comments. Login now