Skip to content

extensions in 'extra' ignore their configs if only 'extra' is requested #1019

Closed
@afontenot

Description

@afontenot

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsRelated to the project documentation.extensionRelated to one or more of the included extensions.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions