diff options
-rw-r--r-- | markdown/extensions/smarty.py | 12 | ||||
-rw-r--r-- | tests/extensions/smarty.html | 1 | ||||
-rw-r--r-- | tests/extensions/smarty.txt | 1 |
3 files changed, 4 insertions, 10 deletions
diff --git a/markdown/extensions/smarty.py b/markdown/extensions/smarty.py index 223f2ad..46e54c1 100644 --- a/markdown/extensions/smarty.py +++ b/markdown/extensions/smarty.py @@ -211,10 +211,10 @@ class SmartyExtension(Extension): rightAngledQuotePattern = SubstituteTextPattern( r'\>\>', (self.substitutions['right-angle-quote'],), md ) - self.angledQuotesPatterns.add( + self.inlinePatterns.add( 'smarty-left-angle-quotes', leftAngledQuotePattern, '_begin' ) - self.angledQuotesPatterns.add( + self.inlinePatterns.add( 'smarty-right-angle-quotes', rightAngledQuotePattern, '>smarty-left-angle-quotes' @@ -249,18 +249,14 @@ class SmartyExtension(Extension): self.educateEllipses(md) if configs['smart_quotes']: self.educateQuotes(md) + if configs['smart_angled_quotes']: + self.educateAngledQuotes(md) if configs['smart_dashes']: self.educateDashes(md) inlineProcessor = InlineProcessor(md) inlineProcessor.inlinePatterns = self.inlinePatterns md.treeprocessors.add('smarty', inlineProcessor, '_end') md.ESCAPED_CHARS.extend(['"', "'"]) - if configs['smart_angled_quotes']: - self.angledQuotesPatterns = OrderedDict() - self.educateAngledQuotes(md) - angledQuotesProcessor = InlineProcessor(md) - angledQuotesProcessor.inlinePatterns = self.angledQuotesPatterns - md.treeprocessors.add('smarty-angledquotes', angledQuotesProcessor, '<inline') def makeExtension(*args, **kwargs): diff --git a/tests/extensions/smarty.html b/tests/extensions/smarty.html index a4ec1a0..d41e467 100644 --- a/tests/extensions/smarty.html +++ b/tests/extensions/smarty.html @@ -16,7 +16,6 @@ em-dashes (—) and ellipes (…)<br /> “<a href="http://example.com">Link</a>” — she said.</p> <p>“Ellipsis within quotes…”</p> <p>Кавычки-«ёлочки»<br /> -«hello»<br /> Anführungszeichen-»Chevrons«</p> <hr /> <p>Escaped -- ndash<br /> diff --git a/tests/extensions/smarty.txt b/tests/extensions/smarty.txt index d7cba6a..48430bb 100644 --- a/tests/extensions/smarty.txt +++ b/tests/extensions/smarty.txt @@ -19,7 +19,6 @@ em-dashes (---) and ellipes (...) "Ellipsis within quotes..." Кавычки-<<ёлочки>> -<<hello>> Anführungszeichen->>Chevrons<< --- -- --- |