Commit 2e7e26fb authored by Jean-Philippe Lang's avatar Jean-Philippe Lang

Fixes html escaping.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1901 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 9131cdf6
......@@ -1045,17 +1045,17 @@ class RedCloth3 < String
codepre += 1
used_offtags[offtag] = true
if codepre - used_offtags.length > 0
htmlesc( line, :NoQuotes ) unless used_offtags['notextile']
htmlesc( line, :NoQuotes )
@pre_list.last << line
line = ""
else
htmlesc( aftertag, :NoQuotes ) if aftertag and not used_offtags['notextile']
htmlesc( aftertag, :NoQuotes ) if aftertag
line = "<redpre##{ @pre_list.length }>"
@pre_list << "#{ $3 }#{ aftertag }"
end
elsif $1 and codepre > 0
if codepre - used_offtags.length > 0
htmlesc( line, :NoQuotes ) unless used_offtags['notextile']
htmlesc( line, :NoQuotes )
@pre_list.last << line
line = ""
end
......
......@@ -190,6 +190,7 @@ class ApplicationHelperTest < HelperTestCase
to_test = {
"<pre>preformatted text</pre>" => "<pre>preformatted text</pre>",
"<notextile>no *textile* formatting</notextile>" => "no *textile* formatting",
"<notextile>this is <tag>a tag</tag></notextile>" => "this is &lt;tag&gt;a tag&lt;/tag&gt;"
}
to_test.each { |text, result| assert_equal result, textilizable(text) }
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment