extensions in 'extra' ignore their configs if only 'extra' is requested · Issue #1019 · Python-Markdown/markdown (original) (raw)

I want all the extensions in extra, so instead of requesting all of them individually I just do something like

html = markdown.markdown(text, extensions=['extra'])

But I need to specify some options (for the 'footnotes' extension), so I include those in the options dict. These options get ignored when just specifying 'extra', I have to explicitly add 'footnotes' to the extensions list for them to be used.

A simple test case:

from markdown import Markdown

text1 = "[^1]\n\n[^1]: test1"
text2 = "[^1]\n\n[^1]: test2"

opts = {'footnotes': {'UNIQUE_IDS': True}}
md = Markdown(extensions=['extra'], extension_configs=opts)

print(md.convert(text1))
md.reset()
print(md.convert(text2))

python-markdown will re-use the footnote numbering, even though I set UNIQUE_IDS.