Patch by Takenori TAKAKI and Marius BALTEANU.
git-svn-id: http://svn.redmine.org/redmine/trunk@17636
e93f8b46-1217-0410-a6f0-
8f06a7374b81
end
OFFTAGS = /(code|pre|kbd|notextile)/
- OFFTAG_MATCH = /(?:(<\/#{ OFFTAGS }>)|(<#{ OFFTAGS }[^>]*>))(.*?)(?=<\/?#{ OFFTAGS }\W|\Z)/mi
+ OFFTAG_MATCH = /(?:(<\/#{ OFFTAGS }\b>)|(<#{ OFFTAGS }\b[^>]*>))(.*?)(?=<\/?#{ OFFTAGS }\b\W|\Z)/mi
OFFTAG_OPEN = /<#{ OFFTAGS }/
OFFTAG_CLOSE = /<\/?#{ OFFTAGS }/
HASTAG_MATCH = /(<\/?\w[^\n]*?>)/m
assert_nothing_raised { to_html(" \v") }
end
+ def test_should_not_handle_as_preformatted_text_tags_that_starts_with_pre
+ text = <<-STR
+<pree>
+ This is some text
+</pree>
+STR
+
+ expected = <<-EXPECTED
+<p><pree><br />
+ This is some text<br />
+</pree></p>
+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)