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: 5 additions & 4 deletions superscript.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"""

import markdown
import markdown.util

# Global Vars
SUPERSCRIPT_RE = r'(\^)([^\^]*)\2' # the number is a superscript^2^
Expand All @@ -34,11 +35,11 @@ class SuperscriptPattern(markdown.inlinepatterns.Pattern):
""" Return a superscript Element (`word^2^`). """
def handleMatch(self, m):
supr = m.group(3)

text = supr
el = markdown.etree.Element("sup")
el.text = markdown.AtomicString(text)

el = markdown.util.etree.Element("sup")
el.text = markdown.util.AtomicString(text)
return el

class SuperscriptExtension(markdown.Extension):
Expand Down