##// END OF EJS Templates
Fixed pre tags containing "<pre*" (#4125)....
Jean-Philippe Lang -
r2916:1d8b4ee77857
parent child
Show More
@@ -1016,7 +1016,7 class RedCloth3 < String
1016 end
1016 end
1017
1017
1018 OFFTAGS = /(code|pre|kbd|notextile)/
1018 OFFTAGS = /(code|pre|kbd|notextile)/
1019 OFFTAG_MATCH = /(?:(<\/#{ OFFTAGS }>)|(<#{ OFFTAGS }[^>]*>))(.*?)(?=<\/?#{ OFFTAGS }|\Z)/mi
1019 OFFTAG_MATCH = /(?:(<\/#{ OFFTAGS }>)|(<#{ OFFTAGS }[^>]*>))(.*?)(?=<\/?#{ OFFTAGS }\W|\Z)/mi
1020 OFFTAG_OPEN = /<#{ OFFTAGS }/
1020 OFFTAG_OPEN = /<#{ OFFTAGS }/
1021 OFFTAG_CLOSE = /<\/?#{ OFFTAGS }/
1021 OFFTAG_CLOSE = /<\/?#{ OFFTAGS }/
1022 HASTAG_MATCH = /(<\/?\w[^\n]*?>)/m
1022 HASTAG_MATCH = /(<\/?\w[^\n]*?>)/m
@@ -258,6 +258,28 RAW
258 to_test.each { |text, result| assert_equal result, textilizable(text) }
258 to_test.each { |text, result| assert_equal result, textilizable(text) }
259 end
259 end
260
260
261 def test_pre_tags
262 raw = <<-RAW
263 Before
264
265 <pre>
266 <prepared-statement-cache-size>32</prepared-statement-cache-size>
267 </pre>
268
269 After
270 RAW
271
272 expected = <<-EXPECTED
273 <p>Before</p>
274 <pre>
275 &lt;prepared-statement-cache-size&gt;32&lt;/prepared-statement-cache-size&gt;
276 </pre>
277 <p>After</p>
278 EXPECTED
279
280 assert_equal expected.gsub(%r{[\r\n\t]}, ''), textilizable(raw).gsub(%r{[\r\n\t]}, '')
281 end
282
261 def test_syntax_highlight
283 def test_syntax_highlight
262 raw = <<-RAW
284 raw = <<-RAW
263 <pre><code class="ruby">
285 <pre><code class="ruby">
General Comments 0
You need to be logged in to leave comments. Login now