From 2e7e26fbb4c82a758bcc0b4a300bbc5ab05d88a9 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Tue, 23 Sep 2008 17:03:51 +0000 Subject: [PATCH] Fixes html escaping. git-svn-id: http://redmine.rubyforge.org/svn/trunk@1901 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redcloth3.rb | 6 +++--- test/unit/helpers/application_helper_test.rb | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/redcloth3.rb b/lib/redcloth3.rb index a5e63262c..cbca2bfd1 100644 --- a/lib/redcloth3.rb +++ b/lib/redcloth3.rb @@ -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 = "" @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 diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb index 35e26ebd4..14ca3cc64 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -190,6 +190,7 @@ class ApplicationHelperTest < HelperTestCase to_test = { "
preformatted text
" => "
preformatted text
", "no *textile* formatting" => "no *textile* formatting", + "this is a tag" => "this is <tag>a tag</tag>" } to_test.each { |text, result| assert_equal result, textilizable(text) } end