diff --git a/md_inline_extension/pelican_inline_markdown_extension.py b/md_inline_extension/pelican_inline_markdown_extension.py index a3a3eb3cf..6059a181d 100644 --- a/md_inline_extension/pelican_inline_markdown_extension.py +++ b/md_inline_extension/pelican_inline_markdown_extension.py @@ -8,8 +8,8 @@ import markdown import re +import xml.etree.ElementTree as etree -from markdown.util import etree from markdown.util import AtomicString class PelicanInlineMarkdownExtensionPattern(markdown.inlinepatterns.Pattern): @@ -21,7 +21,7 @@ def __init__(self, pelican_markdown_extension, tag, pattern): self.config = pelican_markdown_extension.getConfig('config') def handleMatch(self, m): - node = markdown.util.etree.Element(self.tag) + node = etree.Element(self.tag) tag_attributes = self.config.get(m.group('prefix'), ('', 'pelican-inline')) tag_class = 'pelican-inline' # default class tag_style = '' # default is for no styling @@ -54,7 +54,7 @@ def __init__(self, config): config['config'] = [config['config'], 'config for markdown extension'] super(PelicanInlineMarkdownExtension, self).__init__(config) - def extendMarkdown(self, md, md_globals): + def extendMarkdown(self, md): # Regex to detect mathjax config = self.getConfig('config') patterns = [] @@ -66,4 +66,4 @@ def extendMarkdown(self, md, md_globals): inline_regex = r'(?P%s)(?P.+?)\2' % ('|'.join(patterns)) # Process after escapes - md.inlinePatterns.add('texthighlight_inlined', PelicanInlineMarkdownExtensionPattern(self, 'span', inline_regex), '>emphasis2') + md.inlinePatterns.register('texthighlight_inlined', PelicanInlineMarkdownExtensionPattern(self, 'span', inline_regex), 321)