From ef1ab9b3123b2ba356e322b2e980ef3fd4262b6a Mon Sep 17 00:00:00 2001 From: Yukun Guo Date: Mon, 21 Apr 2014 22:41:03 +0800 Subject: [PATCH] etree and AtomicString have been moved to markdown.util in newer versions of markdown --- subscript.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/subscript.py b/subscript.py index c103482..2c2dbd1 100644 --- a/subscript.py +++ b/subscript.py @@ -17,6 +17,11 @@ import markdown +try: + from markdown.util import etree, AtomicString +except: + from markdown import etree, AtomicString + # Global Vars SUBSCRIPT_RE = r'(\~)([^\~]*)\2' # the number is subscript~2~ @@ -27,8 +32,8 @@ def handleMatch(self, m): text = subsc - el = markdown.etree.Element("sub") - el.text = markdown.AtomicString(text) + el = etree.Element('sub') + el.text = AtomicString(text) return el class SubscriptExtension(markdown.Extension):