diff --git a/lib/redmine/wiki_formatting/textile/redcloth3.rb b/lib/redmine/wiki_formatting/textile/redcloth3.rb index c4dc4c25e..2bef56638 100644 --- a/lib/redmine/wiki_formatting/textile/redcloth3.rb +++ b/lib/redmine/wiki_formatting/textile/redcloth3.rb @@ -1025,7 +1025,6 @@ class RedCloth3 < String text.gsub!( /\r/, "\n" ) text.gsub!( /\t/, ' ' ) text.gsub!( /^ +$/, '' ) - text.gsub!( /\n{3,}/, "\n\n" ) text.gsub!( /"$/, "\" " ) # if entire document is indented, flush diff --git a/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb b/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb index 2a7714367..47be58031 100644 --- a/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb +++ b/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb @@ -622,6 +622,18 @@ EXPECTED assert_equal expected.gsub(%r{[\r\n\t]}, ''), to_html(text).gsub(%r{[\r\n\t]}, '') end + def test_should_not_clear_white_space_in_pre + text = <<-STR +
+  This is some text in pre
+
+
+  two whitespace line avobe here.
+
+STR + assert_equal text.chomp, to_html(text) + end + private def assert_html_output(to_test, expect_paragraph = true)