diff options
author | Dmitry Shachnev <mitya57@gmail.com> | 2015-06-19 14:54:09 +0300 |
---|---|---|
committer | Dmitry Shachnev <mitya57@gmail.com> | 2015-06-19 14:54:09 +0300 |
commit | 621cac4163420dc1c5b18d4bc97254a4378d53f5 (patch) | |
tree | 6376096817a26e20b05516e27c0ef7bf68fb36af | |
parent | 789f5165ad7de0f0dd7cc9988e0126c0d732257c (diff) | |
download | markdown-621cac4163420dc1c5b18d4bc97254a4378d53f5.tar.gz markdown-621cac4163420dc1c5b18d4bc97254a4378d53f5.tar.bz2 markdown-621cac4163420dc1c5b18d4bc97254a4378d53f5.zip |
Revert "smarty: Use a separate processor for angled quotes"
That commit caused a regression where `<<` and `>>` inside code
blocks were wrongly replaced with double quotes.
This reverts commit 5029d829c1532f31adc9acbf54d88bb469a69a4f.
-rw-r--r-- | markdown/extensions/smarty.py | 12 |
1 files changed, 4 insertions, 8 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): |