Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions subscript.py
Original file line number Diff line number Diff line change
Expand Up @@ -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~

Expand All @@ -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):
Expand Down