##// END OF EJS Templates
Fixed: class attribute with spaces on pre tags truncated (#7033)....
Jean-Philippe Lang -
r4354:8841ba97c680
parent child
Show More
@@ -1078,7 +1078,7 class RedCloth3 < String
1078 line = "<redpre##{ @pre_list.length }>"
1078 line = "<redpre##{ @pre_list.length }>"
1079 first.match(/<#{ OFFTAGS }([^>]*)>/)
1079 first.match(/<#{ OFFTAGS }([^>]*)>/)
1080 tag = $1
1080 tag = $1
1081 $2.to_s.match(/(class\=\S+)/i)
1081 $2.to_s.match(/(class\=("[^"]+"|'[^']+'))/i)
1082 tag << " #{$1}" if $1
1082 tag << " #{$1}" if $1
1083 @pre_list << "<#{ tag }>#{ aftertag }"
1083 @pre_list << "<#{ tag }>#{ aftertag }"
1084 end
1084 end
@@ -275,6 +275,9 RAW
275 "<!-- opening comment" => "<p>&lt;!-- opening comment</p>",
275 "<!-- opening comment" => "<p>&lt;!-- opening comment</p>",
276 # remove attributes except class
276 # remove attributes except class
277 "<pre class='foo'>some text</pre>" => "<pre class='foo'>some text</pre>",
277 "<pre class='foo'>some text</pre>" => "<pre class='foo'>some text</pre>",
278 '<pre class="foo">some text</pre>' => '<pre class="foo">some text</pre>',
279 "<pre class='foo bar'>some text</pre>" => "<pre class='foo bar'>some text</pre>",
280 '<pre class="foo bar">some text</pre>' => '<pre class="foo bar">some text</pre>',
278 "<pre onmouseover='alert(1)'>some text</pre>" => "<pre>some text</pre>",
281 "<pre onmouseover='alert(1)'>some text</pre>" => "<pre>some text</pre>",
279 }
282 }
280 to_test.each { |text, result| assert_equal result, textilizable(text) }
283 to_test.each { |text, result| assert_equal result, textilizable(text) }
General Comments 0
You need to be logged in to leave comments. Login now