diff options
-rw-r--r-- | markdown/extensions/smarty.py | 4 | ||||
-rw-r--r-- | tests/extensions/smarty.html | 1 | ||||
-rw-r--r-- | tests/extensions/smarty.txt | 2 |
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 ‘60s<br /> ‘quoted’ text and <strong>bold ‘quoted’ text</strong><br /> em-dashes (—) and ellipes (…)<br /> “<a href="http://example.com">Link</a>” — she said.</p> +<p>“Ellipsis within quotes…”</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 |