mirror of
https://github.com/redmine/redmine.git
synced 2025-11-09 06:46:01 +01:00
Comments for Textile text formatting (#20511).
Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@21457 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -719,6 +719,38 @@ class Redmine::WikiFormatting::TextileFormatterTest < ActionView::TestCase
|
||||
assert_equal expected.gsub(%r{[\r\n\t]}, ''), to_html(text).gsub(%r{[\r\n\t]}, '')
|
||||
end
|
||||
|
||||
def test_should_remove_html_comments
|
||||
text = <<~STR
|
||||
<!-- begin -->
|
||||
Hello <!-- comment between words -->world.
|
||||
|
||||
<!--
|
||||
multi-line
|
||||
comment -->Foo
|
||||
|
||||
<pre>
|
||||
This is a code block.
|
||||
<p>
|
||||
<!-- comments in a code block should be preserved -->
|
||||
</p>
|
||||
</pre>
|
||||
STR
|
||||
expected = <<~EXPECTED
|
||||
<p>Hello world.</p>
|
||||
|
||||
<p>Foo</p>
|
||||
|
||||
<pre>
|
||||
This is a code block.
|
||||
<p>
|
||||
<!-- comments in a code block should be preserved -->
|
||||
</p>
|
||||
</pre>
|
||||
|
||||
EXPECTED
|
||||
assert_equal expected.gsub(%r{[\r\n\t]}, ''), to_html(text).gsub(%r{[\r\n\t]}, '')
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def assert_html_output(to_test, expect_paragraph = true)
|
||||
|
||||
Reference in New Issue
Block a user