@@ -57,7 +57,7 module Redmine | |||||
57 | def extract_sections(index) |
|
57 | def extract_sections(index) | |
58 | @pre_list = [] |
|
58 | @pre_list = [] | |
59 | text = self.dup |
|
59 | text = self.dup | |
60 | rip_offtags text |
|
60 | rip_offtags text, false | |
61 | before = '' |
|
61 | before = '' | |
62 | s = '' |
|
62 | s = '' | |
63 | after = '' |
|
63 | after = '' |
@@ -286,6 +286,8 Pre Content: | |||||
286 |
|
286 | |||
287 | h2. Inside pre |
|
287 | h2. Inside pre | |
288 |
|
288 | |||
|
289 | <tag> inside pre block | |||
|
290 | ||||
289 | Morbi facilisis accumsan orci non pharetra. |
|
291 | Morbi facilisis accumsan orci non pharetra. | |
290 | </pre>", |
|
292 | </pre>", | |
291 | # 2 |
|
293 | # 2 | |
@@ -300,6 +302,14 Nulla nunc nisi, egestas in ornare vel, posuere ac libero."] | |||||
300 | assert_section_with_hash STR_WITH_PRE[2], text, 3 |
|
302 | assert_section_with_hash STR_WITH_PRE[2], text, 3 | |
301 | end |
|
303 | end | |
302 |
|
304 | |||
|
305 | def test_update_section_should_not_escape_pre_content_outside_section | |||
|
306 | text = STR_WITH_PRE.join("\n\n") | |||
|
307 | replacement = "New text" | |||
|
308 | ||||
|
309 | assert_equal [STR_WITH_PRE[0..1], "New text"].flatten.join("\n\n"), | |||
|
310 | @formatter.new(text).update_section(3, replacement) | |||
|
311 | end | |||
|
312 | ||||
303 | private |
|
313 | private | |
304 |
|
314 | |||
305 | def assert_html_output(to_test, expect_paragraph = true) |
|
315 | def assert_html_output(to_test, expect_paragraph = true) |
General Comments 0
You need to be logged in to leave comments.
Login now