Fixes html escaping.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1901 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
9131cdf6b9
commit
2e7e26fbb4
|
@ -1045,17 +1045,17 @@ class RedCloth3 < String
|
||||||
codepre += 1
|
codepre += 1
|
||||||
used_offtags[offtag] = true
|
used_offtags[offtag] = true
|
||||||
if codepre - used_offtags.length > 0
|
if codepre - used_offtags.length > 0
|
||||||
htmlesc( line, :NoQuotes ) unless used_offtags['notextile']
|
htmlesc( line, :NoQuotes )
|
||||||
@pre_list.last << line
|
@pre_list.last << line
|
||||||
line = ""
|
line = ""
|
||||||
else
|
else
|
||||||
htmlesc( aftertag, :NoQuotes ) if aftertag and not used_offtags['notextile']
|
htmlesc( aftertag, :NoQuotes ) if aftertag
|
||||||
line = "<redpre##{ @pre_list.length }>"
|
line = "<redpre##{ @pre_list.length }>"
|
||||||
@pre_list << "#{ $3 }#{ aftertag }"
|
@pre_list << "#{ $3 }#{ aftertag }"
|
||||||
end
|
end
|
||||||
elsif $1 and codepre > 0
|
elsif $1 and codepre > 0
|
||||||
if codepre - used_offtags.length > 0
|
if codepre - used_offtags.length > 0
|
||||||
htmlesc( line, :NoQuotes ) unless used_offtags['notextile']
|
htmlesc( line, :NoQuotes )
|
||||||
@pre_list.last << line
|
@pre_list.last << line
|
||||||
line = ""
|
line = ""
|
||||||
end
|
end
|
||||||
|
|
|
@ -190,6 +190,7 @@ class ApplicationHelperTest < HelperTestCase
|
||||||
to_test = {
|
to_test = {
|
||||||
"<pre>preformatted text</pre>" => "<pre>preformatted text</pre>",
|
"<pre>preformatted text</pre>" => "<pre>preformatted text</pre>",
|
||||||
"<notextile>no *textile* formatting</notextile>" => "no *textile* formatting",
|
"<notextile>no *textile* formatting</notextile>" => "no *textile* formatting",
|
||||||
|
"<notextile>this is <tag>a tag</tag></notextile>" => "this is <tag>a tag</tag>"
|
||||||
}
|
}
|
||||||
to_test.each { |text, result| assert_equal result, textilizable(text) }
|
to_test.each { |text, result| assert_equal result, textilizable(text) }
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue