else
htmlesc( aftertag, :NoQuotes ) if aftertag
line = "<redpre##{ @pre_list.length }>"
- @pre_list << "#{ $3 }#{ aftertag }"
+ @pre_list << "#{ $3.gsub(/<(#{ OFFTAGS })[^>]*>/, '<\\1>') }#{ aftertag }"
end
elsif $1 and codepre > 0
if codepre - used_offtags.length > 0
"<pre><code>\nline 1\nline2</code></pre>" => "<pre><code>\nline 1\nline2</code></pre>",
"<pre><div>content</div></pre>" => "<pre><div>content</div></pre>",
"HTML comment: <!-- no comments -->" => "<p>HTML comment: <!-- no comments --></p>",
- "<!-- opening comment" => "<p><!-- opening comment</p>"
+ "<!-- opening comment" => "<p><!-- opening comment</p>",
+ # remove attributes
+ "<pre class='foo'>some text</pre>" => "<pre>some text</pre>",
}
to_test.each { |text, result| assert_equal result, textilizable(text) }
end