From 2638bd66710933552058d4c7cb278d8cc71a3041 Mon Sep 17 00:00:00 2001 From: posativ Date: Mon, 2 Apr 2012 12:13:07 +0200 Subject: [PATCH] markdown 2.1 compatibility --- mdx_asciimathml.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mdx_asciimathml.py b/mdx_asciimathml.py index f50ee6c..2b13354 100644 --- a/mdx_asciimathml.py +++ b/mdx_asciimathml.py @@ -36,7 +36,12 @@ def getCompiledRegExp(self): return re.compile(r'^(.*)\$\$([^\$]*)\$\$(.*)$', re.M) # $$ a $$ def handleMatch(self, m): - math = asciimathml.parse(m.group(2).strip(), markdown.etree.Element, markdown.AtomicString) + if markdown.version_info < (2, 1, 0): + math = asciimathml.parse(m.group(2).strip(), markdown.etree.Element, + markdown.AtomicString) + else: + math = asciimathml.parse(m.group(2).strip(), + markdown.util.etree.Element, markdown.util.AtomicString) math.set('xmlns', 'http://www.w3.org/1998/Math/MathML') return math