Skip to content

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

Description

@lmfont

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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