aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--markdown/treeprocessors.py2
-rw-r--r--tests/extensions/smarty.html6
-rw-r--r--tests/extensions/smarty.txt7
3 files changed, 12 insertions, 3 deletions
diff --git a/markdown/treeprocessors.py b/markdown/treeprocessors.py
index 113ad3c..a82141a 100644
--- a/markdown/treeprocessors.py
+++ b/markdown/treeprocessors.py
@@ -358,4 +358,4 @@ class PrettifyTreeprocessor(Treeprocessor):
pres = root.getiterator('pre')
for pre in pres:
if len(pre) and pre[0].tag == 'code':
- pre[0].text = pre[0].text.rstrip() + '\n'
+ pre[0].text = util.AtomicString(pre[0].text.rstrip() + '\n')
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
diff --git a/tests/extensions/smarty.txt b/tests/extensions/smarty.txt
index 3b034cf..35fb219 100644
--- a/tests/extensions/smarty.txt
+++ b/tests/extensions/smarty.txt
@@ -28,4 +28,9 @@ Escaped \-- ndash
Escaped ellipsis\...
'Escaped \"quotes\" in real ones'
-\'"Real" quotes in escaped ones\' \ No newline at end of file
+\'"Real" quotes in escaped ones\'
+
+Skip `"code" -- --- 'spans' ...`.
+
+ Also skip "code" 'blocks'
+ foo -- bar --- baz ...