##// END OF EJS Templates
Merged r3030 from trunk....
Eric Davis -
r2931:b19ba93966ba
parent child
Show More
@@ -1011,7 +1011,7 class RedCloth3 < String
1011 end
1011 end
1012
1012
1013 OFFTAGS = /(code|pre|kbd|notextile)/
1013 OFFTAGS = /(code|pre|kbd|notextile)/
1014 OFFTAG_MATCH = /(?:(<\/#{ OFFTAGS }>)|(<#{ OFFTAGS }[^>]*>))(.*?)(?=<\/?#{ OFFTAGS }|\Z)/mi
1014 OFFTAG_MATCH = /(?:(<\/#{ OFFTAGS }>)|(<#{ OFFTAGS }[^>]*>))(.*?)(?=<\/?#{ OFFTAGS }\W|\Z)/mi
1015 OFFTAG_OPEN = /<#{ OFFTAGS }/
1015 OFFTAG_OPEN = /<#{ OFFTAGS }/
1016 OFFTAG_CLOSE = /<\/?#{ OFFTAGS }/
1016 OFFTAG_CLOSE = /<\/?#{ OFFTAGS }/
1017 HASTAG_MATCH = /(<\/?\w[^\n]*?>)/m
1017 HASTAG_MATCH = /(<\/?\w[^\n]*?>)/m
@@ -251,7 +251,29 RAW
251 to_test.each { |text, result| assert_equal result, textilizable(text) }
251 to_test.each { |text, result| assert_equal result, textilizable(text) }
252 end
252 end
253
253
254 def syntax_highlight
254 def test_pre_tags
255 raw = <<-RAW
256 Before
257
258 <pre>
259 <prepared-statement-cache-size>32</prepared-statement-cache-size>
260 </pre>
261
262 After
263 RAW
264
265 expected = <<-EXPECTED
266 <p>Before</p>
267 <pre>
268 &lt;prepared-statement-cache-size&gt;32&lt;/prepared-statement-cache-size&gt;
269 </pre>
270 <p>After</p>
271 EXPECTED
272
273 assert_equal expected.gsub(%r{[\r\n\t]}, ''), textilizable(raw).gsub(%r{[\r\n\t]}, '')
274 end
275
276 def test_syntax_highlight
255 raw = <<-RAW
277 raw = <<-RAW
256 <pre><code class="ruby">
278 <pre><code class="ruby">
257 # Some ruby code here
279 # Some ruby code here
General Comments 0
You need to be logged in to leave comments. Login now