]> source.dussan.org Git - redmine.git/commitdiff
Fixed: Angle brackets within 'pre' blocks are silently replaced by HTML entities...
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 28 Nov 2011 17:56:50 +0000 (17:56 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 28 Nov 2011 17:56:50 +0000 (17:56 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7969 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/wiki_formatting/textile/formatter.rb
test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb

index 1beb9563c7e9e925b3434559ed82213f323b0249..0e948cfd5d96cc470e7557893db83680ef84e1cb 100644 (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 = ''
index ec9b883b0b8cb00de950929d9a499b33f4be48a2..853b0d522d5480816932edc06ed384612b5cbe31 100644 (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)