summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-11-28 22:08:15 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-11-28 22:08:15 +0000
commitd66c8faa9bc5521bc6659532542b13a0f05f0cd1 (patch)
treeb69bcdf6d1089fcb0024dad0075301788beaaebf /lib
parentc5cabfe106c913d709e27ff539de09037f4223b4 (diff)
downloadredmine-d66c8faa9bc5521bc6659532542b13a0f05f0cd1.tar.gz
redmine-d66c8faa9bc5521bc6659532542b13a0f05f0cd1.zip
Fixed: Wiki section edit escapes pre tags inside pre blocks (#9673).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7976 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/redcloth3.rb6
-rw-r--r--lib/redmine/wiki_formatting/textile/formatter.rb2
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/redcloth3.rb b/lib/redcloth3.rb
index 8a33943dc..d09804f41 100644
--- a/lib/redcloth3.rb
+++ b/lib/redcloth3.rb
@@ -1058,7 +1058,7 @@ class RedCloth3 < String
end
end
- def rip_offtags( text, escape_aftertag=true )
+ def rip_offtags( text, escape_aftertag=true, escape_line=true )
if text =~ /<.*>/
## strip and encode <pre> content
codepre, used_offtags = 0, {}
@@ -1068,7 +1068,7 @@ class RedCloth3 < String
codepre += 1
used_offtags[offtag] = true
if codepre - used_offtags.length > 0
- htmlesc( line, :NoQuotes )
+ htmlesc( line, :NoQuotes ) if escape_line
@pre_list.last << line
line = ""
else
@@ -1086,7 +1086,7 @@ class RedCloth3 < String
end
elsif $1 and codepre > 0
if codepre - used_offtags.length > 0
- htmlesc( line, :NoQuotes )
+ htmlesc( line, :NoQuotes ) if escape_line
@pre_list.last << line
line = ""
end
diff --git a/lib/redmine/wiki_formatting/textile/formatter.rb b/lib/redmine/wiki_formatting/textile/formatter.rb
index 1122883eb..22cd5cbf9 100644
--- a/lib/redmine/wiki_formatting/textile/formatter.rb
+++ b/lib/redmine/wiki_formatting/textile/formatter.rb
@@ -57,7 +57,7 @@ module Redmine
def extract_sections(index)
@pre_list = []
text = self.dup
- rip_offtags text, false
+ rip_offtags text, false, false
before = ''
s = ''
after = ''