diff --git a/lib/redmine/wiki_formatting/markdown/formatter.rb b/lib/redmine/wiki_formatting/markdown/formatter.rb index 9082c3658..2b058509f 100644 --- a/lib/redmine/wiki_formatting/markdown/formatter.rb +++ b/lib/redmine/wiki_formatting/markdown/formatter.rb @@ -125,7 +125,7 @@ module Redmine @@formatter ||= Redcarpet::Markdown.new( Redmine::WikiFormatting::Markdown::HTML.new( :filter_html => true, - :hard_wrap => true + :hard_wrap => false ), :autolink => true, :fenced_code_blocks => true, diff --git a/test/unit/lib/redmine/wiki_formatting/markdown_formatter_test.rb b/test/unit/lib/redmine/wiki_formatting/markdown_formatter_test.rb index 465bb4711..b46143547 100644 --- a/test/unit/lib/redmine/wiki_formatting/markdown_formatter_test.rb +++ b/test/unit/lib/redmine/wiki_formatting/markdown_formatter_test.rb @@ -173,6 +173,26 @@ Nulla nunc nisi, egestas in ornare vel, posuere ac libero."] assert_equal '

This text should be underlined

', @formatter.new(text).to_html.strip end + def test_no_hard_wrap + text = <<-STR +Para 1 line one +still line one. + +Para 2 line 1 with 2 spaces#{" "} +line 2. +STR + + expected = <<-EXPECTED +

Para 1 line one +still line one.

+ +

Para 2 line 1 with 2 spaces
+line 2.

+EXPECTED + + assert_equal expected, @formatter.new(text).to_html + end + private def assert_section_with_hash(expected, text, index)