aboutsummaryrefslogtreecommitdiffstats
path: root/tests/extensions/smarty.html
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2014-09-08 22:37:45 -0400
committerWaylan Limberg <waylan@gmail.com>2014-09-08 22:37:45 -0400
commitb91a37be0ab019fa1ee0b94014a6ed0c7ff5dbf5 (patch)
tree6eb33cd6eebc1a9f90c99976d4cbfac4b776fd94 /tests/extensions/smarty.html
parent7db56daedf8a6006222f55eeeab748e7789fba89 (diff)
downloadmarkdown-b91a37be0ab019fa1ee0b94014a6ed0c7ff5dbf5.tar.gz
markdown-b91a37be0ab019fa1ee0b94014a6ed0c7ff5dbf5.tar.bz2
markdown-b91a37be0ab019fa1ee0b94014a6ed0c7ff5dbf5.zip
Code Blocks must always be AtomicStrings
Fixes #340. The "inline" TreeProcessor runs before the "prettify" TreeProcessor, but the "smarty" TreeProcessor (wich is just another instance of `InlineProcessor`) runs after the "prettify" TreeProcessor. The problem was that the "prettify" TreeProcessor was losing the AtomicString quality of the text of code blocks (any operation on a string creates a new string. When that string is an AtomicString, the new string must explicitly be declared as an AtomicString. As the "prettify" TreeProcessor cleans up newlines on code blocks, it was changing the AtomicString to a normal string. And as `InlineProcessor` identifies what elements to skip solely by whether the text is an AtomicString, the "smarty" instance was running on code blocks. Importantly, I added a test of code blocks and spans for smarty, so this shouldn't break again.
Diffstat (limited to 'tests/extensions/smarty.html')
-rw-r--r--tests/extensions/smarty.html6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/extensions/smarty.html b/tests/extensions/smarty.html
index 0907a73..6305060 100644
--- a/tests/extensions/smarty.html
+++ b/tests/extensions/smarty.html
@@ -22,4 +22,8 @@ Anführungszeichen-&raquo;Chevrons&laquo;</p>
'Escaped' "quotes"<br />
Escaped ellipsis...</p>
<p>&lsquo;Escaped "quotes" in real ones&rsquo;<br />
-'&ldquo;Real&rdquo; quotes in escaped ones'</p> \ No newline at end of file
+'&ldquo;Real&rdquo; quotes in escaped ones'</p>
+<p>Skip <code>"code" -- --- 'spans' ...</code>.</p>
+<pre><code>Also skip "code" 'blocks'
+foo -- bar --- baz ...
+</code></pre> \ No newline at end of file