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
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 = ''
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 8d33db1b4..26250997e 100644
--- a/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb
+++ b/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb
@@ -284,6 +284,11 @@ Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas sed libero.",
end
+
+ Place your code here.
+
+
+
Morbi facilisis accumsan orci non pharetra.