diff options
author | Waylan Limberg <waylan.limberg@icloud.com> | 2014-06-08 08:18:40 -0400 |
---|---|---|
committer | Waylan Limberg <waylan.limberg@icloud.com> | 2014-06-08 08:18:40 -0400 |
commit | a6307cd48979860cc929ef7e7e402941d9f993e8 (patch) | |
tree | bb5ccd804024f1827c83d0474f3f7d50f24b98c1 | |
parent | 8faef1620823eb10e3a76711621f53782f7fe36b (diff) | |
parent | cd076d004e9a666c0d3e179371de40cb6ca466d2 (diff) | |
download | markdown-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.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 |