Skip to content

Honor tags added to block_level_elements after md_in_html loads - #1629

Open
gyanu2507 wants to merge 1 commit into
Python-Markdown:masterfrom
gyanu2507:md-in-html-live-block-tags
Open

Honor tags added to block_level_elements after md_in_html loads#1629
gyanu2507 wants to merge 1 commit into
Python-Markdown:masterfrom
gyanu2507:md-in-html-live-block-tags

Conversation

@gyanu2507

@gyanu2507 gyanu2507 commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Summary

md_in_html copied Markdown.block_level_elements when the extractor was constructed. Tags registered later with md.block_level_elements.append('a-b') were therefore ignored, so custom elements never got block-level treatment or markdown="1" parsing.

The extractor now reads the live list. That is the change discussed in #1246 (not treating every hyphenated name as a block tag).

Test plan

  • python3 -m unittest tests.test_syntax.extensions.test_md_in_html (198 tests)

Fixes #1246

The extension copied Markdown.block_level_elements at init, so
md.block_level_elements.append() after construction was ignored.
Read the live list instead.

Fixes Python-Markdown#1246
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extension md_in_html does not recognize tags with hyphens

1 participant