diff --git a/lib/redcloth.rb b/lib/redcloth.rb
index f94c95738..fb6a053c6 100644
--- a/lib/redcloth.rb
+++ b/lib/redcloth.rb
@@ -764,7 +764,7 @@ class RedCloth < String
([\s\[{(]|[#{PUNCT}])? # $pre
" # start
(#{C}) # $atts
- ([^"]+?) # $text
+ ([^"\n]+?) # $text
\s?
(?:\(([^)]+?)\)(?="))? # $title
":
diff --git a/lib/redmine/wiki_formatting.rb b/lib/redmine/wiki_formatting.rb
index 8866e8cde..3c1eac020 100644
--- a/lib/redmine/wiki_formatting.rb
+++ b/lib/redmine/wiki_formatting.rb
@@ -45,7 +45,7 @@ module Redmine
# Patch for RedCloth. Fixed in RedCloth r128 but _why hasn't released it yet.
# http://code.whytheluckystiff.net/redcloth/changeset/128
def hard_break( text )
- text.gsub!( /(.)\n(?!\n|\Z| *([#*=]+(\s|$)|[{|]))/, "\\1
" ) if hard_breaks
+ text.gsub!( /(.)\n(?!\n|\Z| *([#*=]+(\s|$)|[{|]))/, "\\1
\n" ) if hard_breaks
end
# Patch to add code highlighting support to RedCloth
diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb
index 25559ebc1..ffee28b00 100644
--- a/test/unit/helpers/application_helper_test.rb
+++ b/test/unit/helpers/application_helper_test.rb
@@ -58,7 +58,9 @@ class ApplicationHelperTest < HelperTestCase
to_test = {
'This is a "link":http://foo.bar' => 'This is a link',
'This is an intern "link":/foo/bar' => 'This is an intern link',
- '"link (Link title)":http://foo.bar' => 'link'
+ '"link (Link title)":http://foo.bar' => 'link',
+ # 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
\nand another on a second line\":test"
}
to_test.each { |text, result| assert_equal "
#{result}
", textilizable(text) } end