diff --git a/lib/redcloth.rb b/lib/redcloth.rb index 421e5bf01..2b36421d9 100644 --- a/lib/redcloth.rb +++ b/lib/redcloth.rb @@ -1027,7 +1027,7 @@ class RedCloth < String else htmlesc( aftertag, :NoQuotes ) if aftertag and not used_offtags['notextile'] line = "" - @pre_list << "#{ $3 }#{ aftertag }" + @pre_list << "#{ $3.gsub(/<(#{ OFFTAGS })[^>]*>/, '<\\1>') }#{ aftertag }" end elsif $1 and codepre > 0 if codepre - used_offtags.length > 0 diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb index bea009e38..5fdf65961 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -146,7 +146,9 @@ class ApplicationHelperTest < HelperTestCase "
\nline 1\nline2
" => "
\nline 1\nline2
", "
content
" => "
<div>content</div>
", "HTML comment: " => "

HTML comment: <!-- no comments -->

", - "