diff options
-rw-r--r-- | markdown/extensions/attr_list.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/markdown/extensions/attr_list.py b/markdown/extensions/attr_list.py index 60287fe..1a1b87f 100644 --- a/markdown/extensions/attr_list.py +++ b/markdown/extensions/attr_list.py @@ -120,8 +120,12 @@ class AttrListTreeprocessor(markdown.treeprocessors.Treeprocessor): class AttrListExtension(markdown.extensions.Extension): def extendMarkdown(self, md, md_globals): - # insert after 'inline' treeprocessor - md.treeprocessors.add('attr_list', AttrListTreeprocessor(md), '>inline') + if 'headerid' in md.treeprocessors.keys(): + # insert after 'headerid' treeprocessor + md.treeprocessors.add('attr_list', AttrListTreeprocessor(md), '>headerid') + else: + # insert after 'inline' treeprocessor + md.treeprocessors.add('attr_list', AttrListTreeprocessor(md), '>inline') def makeExtension(configs={}): |