From 8be0d1f517a0857b69763fd3bad1875badede2d2 Mon Sep 17 00:00:00 2001 From: Lawrence Kesteloot Date: Sat, 31 May 2014 18:58:11 -0700 Subject: Add failing unit test for smarty: ellipsis before close double quote generates opening double quote. --- tests/extensions/smarty.html | 1 + tests/extensions/smarty.txt | 2 ++ 2 files changed, 3 insertions(+) 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
‘quoted’ text and bold ‘quoted’ text
em-dashes (—) and ellipes (…)
Link” — she said.

+

“Ellipsis within quotes…”


Escaped -- ndash
'Escaped' "quotes"
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 -- cgit v1.2.3 From cd076d004e9a666c0d3e179371de40cb6ca466d2 Mon Sep 17 00:00:00 2001 From: Dmitry Shachnev Date: Sun, 8 Jun 2014 15:50:02 +0400 Subject: Fix #315: Change order of smarty patterns to make the test pass again --- markdown/extensions/smarty.py | 4 ++-- 1 file changed, 2 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') -- cgit v1.2.3