Fixed: Angle brackets within 'pre' blocks are silently replaced by HTML entities during wiki section-edit (#9673).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7969 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2011-11-28 17:56:50 +00:00
parent 5c60a4f6ca
commit 9f15517095
2 changed files with 11 additions and 1 deletions

View File

@ -57,7 +57,7 @@ module Redmine
def extract_sections(index)
@pre_list = []
text = self.dup
rip_offtags text
rip_offtags text, false
before = ''
s = ''
after = ''

View File

@ -286,6 +286,8 @@ Pre Content:
h2. Inside pre
<tag> inside pre block
Morbi facilisis accumsan orci non pharetra.
</pre>",
# 2
@ -300,6 +302,14 @@ Nulla nunc nisi, egestas in ornare vel, posuere ac libero."]
assert_section_with_hash STR_WITH_PRE[2], text, 3
end
def test_update_section_should_not_escape_pre_content_outside_section
text = STR_WITH_PRE.join("\n\n")
replacement = "New text"
assert_equal [STR_WITH_PRE[0..1], "New text"].flatten.join("\n\n"),
@formatter.new(text).update_section(3, replacement)
end
private
def assert_html_output(to_test, expect_paragraph = true)