Defect #22323 » 22323-with-test.patch
| lib/redmine/wiki_formatting/markdown/formatter.rb | ||
|---|---|---|
|
@@formatter ||= Redcarpet::Markdown.new(
|
||
|
Redmine::WikiFormatting::Markdown::HTML.new(
|
||
|
:filter_html => true,
|
||
|
:hard_wrap => true
|
||
|
:hard_wrap => false
|
||
|
),
|
||
|
:autolink => true,
|
||
|
:fenced_code_blocks => true,
|
||
| test/unit/lib/redmine/wiki_formatting/markdown_formatter_test.rb | ||
|---|---|---|
|
text = 'This _text_ should be underlined'
|
||
|
assert_equal '<p>This <u>text</u> should be underlined</p>', @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
|
||
|
<p>Para 1 line one
|
||
|
still line one.</p>
|
||
|
<p>Para 2 line 1 with 2 spaces<br>
|
||
|
line 2.</p>
|
||
|
EXPECTED
|
||
|
assert_equal expected, @formatter.new(text).to_html
|
||
|
end
|
||
|
end
|
||
|
end
|
||