end
OFFTAGS = /(code|pre|kbd|notextile)/
- OFFTAG_MATCH = /(?:(<\/#{ OFFTAGS }>)|(<#{ OFFTAGS }[^>]*>))(.*?)(?=<\/?#{ OFFTAGS }|\Z)/mi
+ OFFTAG_MATCH = /(?:(<\/#{ OFFTAGS }>)|(<#{ OFFTAGS }[^>]*>))(.*?)(?=<\/?#{ OFFTAGS }\W|\Z)/mi
OFFTAG_OPEN = /<#{ OFFTAGS }/
OFFTAG_CLOSE = /<\/?#{ OFFTAGS }/
HASTAG_MATCH = /(<\/?\w[^\n]*?>)/m
to_test.each { |text, result| assert_equal result, textilizable(text) }
end
+ def test_pre_tags
+ raw = <<-RAW
+Before
+
+<pre>
+<prepared-statement-cache-size>32</prepared-statement-cache-size>
+</pre>
+
+After
+RAW
+
+ expected = <<-EXPECTED
+<p>Before</p>
+<pre>
+<prepared-statement-cache-size>32</prepared-statement-cache-size>
+</pre>
+<p>After</p>
+EXPECTED
+
+ assert_equal expected.gsub(%r{[\r\n\t]}, ''), textilizable(raw).gsub(%r{[\r\n\t]}, '')
+ end
+
def test_syntax_highlight
raw = <<-RAW
<pre><code class="ruby">