From c5cabfe106c913d709e27ff539de09037f4223b4 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Mon, 28 Nov 2011 21:45:02 +0000 Subject: [PATCH] Fixed: Wiki section edit escapes code tags inside pre blocks (#9673). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7975 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/wiki_formatting/textile/formatter.rb | 3 ++- .../lib/redmine/wiki_formatting/textile_formatter_test.rb | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/redmine/wiki_formatting/textile/formatter.rb b/lib/redmine/wiki_formatting/textile/formatter.rb index 0e948cfd5..1122883eb 100644 --- a/lib/redmine/wiki_formatting/textile/formatter.rb +++ b/lib/redmine/wiki_formatting/textile/formatter.rb @@ -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
" ) 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? 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 853b0d522..8d33db1b4 100644 --- a/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb +++ b/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb @@ -279,6 +279,11 @@ Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas sed libero.", # 1 "h2. Heading 2 +

+  def foo
+  end
+
+ Morbi facilisis accumsan orci non pharetra.
-- 
2.39.5