summaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2022-10-17 13:35:20 +0000
committerGo MAEDA <maeda@farend.jp>2022-10-17 13:35:20 +0000
commit1d9f5c67426a8e05eb94a0bdce4ea7d7a837f595 (patch)
treeba6c0c0bce5128c88bfa0dee0488b26dad9549ce /test/unit
parent823080b45e58563f989b992789ed340d358ed955 (diff)
downloadredmine-1d9f5c67426a8e05eb94a0bdce4ea7d7a837f595.tar.gz
redmine-1d9f5c67426a8e05eb94a0bdce4ea7d7a837f595.zip
Escape tags that start with pre (#37767).
Patch by Holger Just. git-svn-id: https://svn.redmine.org/redmine/trunk@21902 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb11
1 files changed, 11 insertions, 0 deletions
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 23f6d7538..9d2a1815d 100644
--- a/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb
+++ b/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb
@@ -719,6 +719,17 @@ 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_escape_tags_that_start_with_pre
+ text = <<~STR
+ <preä demo>Text
+ STR
+
+ expected = <<~EXPECTED
+ <p>&lt;preä demo&gt;Text</p>
+ EXPECTED
+ 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 -->