]> source.dussan.org Git - redmine.git/commitdiff
Fixed: Wiki section edit escapes code tags inside pre blocks (#9673).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 28 Nov 2011 21:45:02 +0000 (21:45 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 28 Nov 2011 21:45:02 +0000 (21:45 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7975 e93f8b46-1217-0410-a6f0-8f06a7374b81

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

index 0e948cfd5d96cc470e7557893db83680ef84e1cb..1122883eb0d6aa68a55f9ff9b198b3b310b22e39 100644 (file)
@@ -97,7 +97,7 @@ module Redmine
             end
           end
           sections = [before.strip, s.strip, after.strip]
-          sections.each {|section| smooth_offtags section}
+          sections.each {|section| smooth_offtags_without_code_highlighting section}
           sections
         end
 
@@ -109,6 +109,7 @@ module Redmine
           text.gsub!( /(.)\n(?!\n|\Z| *([#*=]+(\s|$)|[{|]))/, "\\1<br />" ) if hard_breaks
         end
 
+        alias :smooth_offtags_without_code_highlighting :smooth_offtags
         # Patch to add code highlighting support to RedCloth
         def smooth_offtags( text )
           unless @pre_list.empty?
index 853b0d522d5480816932edc06ed384612b5cbe31..8d33db1b42ec3b1e56a7e553818c47d76d4d0996 100644 (file)
@@ -279,6 +279,11 @@ Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas sed libero.",
   # 1
 "h2. Heading 2
 
+<pre><code class=\"ruby\">
+  def foo
+  end
+</code></pre>
+
 Morbi facilisis accumsan orci non pharetra.
 
 <pre>