aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2014-03-13 14:12:59 -0400
committerWaylan Limberg <waylan@gmail.com>2014-03-13 14:12:59 -0400
commit76dd29a121611be0e1068c73bc20d9591d9be5cf (patch)
tree081564463f7a8b70fc863bd2503e4881d7aed13a
parent20911bfd67183aa59889e8fbf1635a54016cd171 (diff)
parent4ca11effd18372dc6b5e8cf852130a7e75c27eb6 (diff)
downloadmarkdown-76dd29a121611be0e1068c73bc20d9591d9be5cf.tar.gz
markdown-76dd29a121611be0e1068c73bc20d9591d9be5cf.tar.bz2
markdown-76dd29a121611be0e1068c73bc20d9591d9be5cf.zip
Merge pull request #296 from mitya57/smarty-fixes
Smarty extension fixes
-rw-r--r--markdown/extensions/smarty.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/markdown/extensions/smarty.py b/markdown/extensions/smarty.py
index f452afc..2f946f8 100644
--- a/markdown/extensions/smarty.py
+++ b/markdown/extensions/smarty.py
@@ -73,7 +73,7 @@ from ..util import parseBoolValue
# Constants for quote education.
punctClass = r"""[!"#\$\%'()*+,-.\/:;<=>?\@\[\\\]\^_`{|}~]"""
endOfWordClass = r"[\s.,;:!?)]"
-closeClass = r"[^\ \t\r\n\[\{\(\-\u0002\u0003]"
+closeClass = "[^\ \t\r\n\[\{\(\-\u0002\u0003]"
openingQuotesBase = (
'(\s' # a whitespace char
@@ -150,14 +150,14 @@ class SmartyExtension(Extension):
md.inlinePatterns.add(name, pattern, after)
def educateDashes(self, md):
- emDashesPattern = SubstituteTextPattern(r'(?<!-)---(?!-)', '&mdash;', md)
- enDashesPattern = SubstituteTextPattern(r'(?<!-)--(?!-)', '&ndash;', md)
+ emDashesPattern = SubstituteTextPattern(r'(?<!-)---(?!-)', ('&mdash;',), md)
+ enDashesPattern = SubstituteTextPattern(r'(?<!-)--(?!-)', ('&ndash;',), md)
md.inlinePatterns.add('smarty-em-dashes', emDashesPattern, '>entity')
md.inlinePatterns.add('smarty-en-dashes', enDashesPattern,
'>smarty-em-dashes')
def educateEllipses(self, md):
- ellipsesPattern = SubstituteTextPattern(r'(?<!\.)\.{3}(?!\.)', '&hellip;', md)
+ ellipsesPattern = SubstituteTextPattern(r'(?<!\.)\.{3}(?!\.)', ('&hellip;',), md)
md.inlinePatterns.add('smarty-ellipses', ellipsesPattern, '>entity')
def educateQuotes(self, md):