@@ -1016,7 +1016,7 class RedCloth3 < String | |||
|
1016 | 1016 | end |
|
1017 | 1017 | |
|
1018 | 1018 | OFFTAGS = /(code|pre|kbd|notextile)/ |
|
1019 | OFFTAG_MATCH = /(?:(<\/#{ OFFTAGS }>)|(<#{ OFFTAGS }[^>]*>))(.*?)(?=<\/?#{ OFFTAGS }|\Z)/mi | |
|
1019 | OFFTAG_MATCH = /(?:(<\/#{ OFFTAGS }>)|(<#{ OFFTAGS }[^>]*>))(.*?)(?=<\/?#{ OFFTAGS }\W|\Z)/mi | |
|
1020 | 1020 | OFFTAG_OPEN = /<#{ OFFTAGS }/ |
|
1021 | 1021 | OFFTAG_CLOSE = /<\/?#{ OFFTAGS }/ |
|
1022 | 1022 | HASTAG_MATCH = /(<\/?\w[^\n]*?>)/m |
@@ -258,6 +258,28 RAW | |||
|
258 | 258 | to_test.each { |text, result| assert_equal result, textilizable(text) } |
|
259 | 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 | <prepared-statement-cache-size>32</prepared-statement-cache-size> | |
|
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 | 283 | def test_syntax_highlight |
|
262 | 284 | raw = <<-RAW |
|
263 | 285 | <pre><code class="ruby"> |
General Comments 0
You need to be logged in to leave comments.
Login now