aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaylan Limberg <waylan.limberg@icloud.com>2014-06-08 08:18:40 -0400
committerWaylan Limberg <waylan.limberg@icloud.com>2014-06-08 08:18:40 -0400
commita6307cd48979860cc929ef7e7e402941d9f993e8 (patch)
treebb5ccd804024f1827c83d0474f3f7d50f24b98c1
parent8faef1620823eb10e3a76711621f53782f7fe36b (diff)
parentcd076d004e9a666c0d3e179371de40cb6ca466d2 (diff)
downloadmarkdown-a6307cd48979860cc929ef7e7e402941d9f993e8.tar.gz
markdown-a6307cd48979860cc929ef7e7e402941d9f993e8.tar.bz2
markdown-a6307cd48979860cc929ef7e7e402941d9f993e8.zip
Merge pull request #316 from mitya57/master
Fix for smarty extension
-rw-r--r--markdown/extensions/smarty.py4
-rw-r--r--tests/extensions/smarty.html1
-rw-r--r--tests/extensions/smarty.txt2
3 files changed, 5 insertions, 2 deletions
diff --git a/markdown/extensions/smarty.py b/markdown/extensions/smarty.py
index 6f15d2c..21f30a4 100644
--- a/markdown/extensions/smarty.py
+++ b/markdown/extensions/smarty.py
@@ -182,12 +182,12 @@ class SmartyExtension(Extension):
def extendMarkdown(self, md, md_globals):
configs = self.getConfigs()
self.inlinePatterns = OrderedDict()
+ if configs['smart_ellipses']:
+ self.educateEllipses(md)
if configs['smart_quotes']:
self.educateQuotes(md)
if configs['smart_dashes']:
self.educateDashes(md)
- if configs['smart_ellipses']:
- self.educateEllipses(md)
inlineProcessor = InlineProcessor(md)
inlineProcessor.inlinePatterns = self.inlinePatterns
md.treeprocessors.add('smarty', inlineProcessor, '_end')
diff --git a/tests/extensions/smarty.html b/tests/extensions/smarty.html
index 6b5e698..16aba6d 100644
--- a/tests/extensions/smarty.html
+++ b/tests/extensions/smarty.html
@@ -13,6 +13,7 @@ one two &lsquo;60s<br />
&lsquo;quoted&rsquo; text and <strong>bold &lsquo;quoted&rsquo; text</strong><br />
em-dashes (&mdash;) and ellipes (&hellip;)<br />
&ldquo;<a href="http://example.com">Link</a>&rdquo; &mdash; she said.</p>
+<p>&ldquo;Ellipsis within quotes&hellip;&rdquo;</p>
<hr />
<p>Escaped -- ndash<br />
'Escaped' "quotes"<br />
diff --git a/tests/extensions/smarty.txt b/tests/extensions/smarty.txt
index fbf4d03..00dc1a2 100644
--- a/tests/extensions/smarty.txt
+++ b/tests/extensions/smarty.txt
@@ -15,6 +15,8 @@ It's fun. What's fun?
em-dashes (---) and ellipes (...)
"[Link](http://example.com)" --- she said.
+"Ellipsis within quotes..."
+
--- -- ---
Escaped \-- ndash