Skip to content

Preserve setext headings with colon titles - #4157

Open
ishaanlabs-gg wants to merge 1 commit into
mkdocs:masterfrom
ishaanlabs-gg:fix-setext-title-colon-meta
Open

Preserve setext headings with colon titles#4157
ishaanlabs-gg wants to merge 1 commit into
mkdocs:masterfrom
ishaanlabs-gg:fix-setext-title-colon-meta

Conversation

@ishaanlabs-gg

Copy link
Copy Markdown

Summary

  • preserve colon-containing setext headings like Foo: Bar instead of treating them as MultiMarkdown metadata
  • add regression coverage for the metadata parser behavior

Fixes #4079.

Tests

  • PYTHONPATH=/Volumes/STOREJET/Documents/OSC/repos/mkdocs-list-rendering /Volumes/STOREJET/Documents/OSC/repos/mkdocs/.venv-codex/bin/python -m unittest mkdocs.tests.utils.utils_tests.UtilsTests.test_mm_meta_data_ignores_setext_heading mkdocs.tests.utils.utils_tests.UtilsTests.test_mm_meta_data mkdocs.tests.utils.utils_tests.UtilsTests.test_mm_meta_data_blank_first_line mkdocs.tests.utils.utils_tests.UtilsTests.test_yaml_meta_data mkdocs.tests.utils.utils_tests.UtilsTests.test_no_meta_data
  • PYTHONPATH=/Volumes/STOREJET/Documents/OSC/repos/mkdocs-list-rendering /Volumes/STOREJET/Documents/OSC/repos/mkdocs/.venv-codex/bin/python -m unittest mkdocs.tests.utils.utils_tests
  • PYTHONPATH=/Volumes/STOREJET/Documents/OSC/repos/mkdocs-list-rendering /Volumes/STOREJET/Documents/OSC/repos/mkdocs/.venv-codex/bin/python -m compileall -q mkdocs/utils/meta.py mkdocs/tests/utils/utils_tests.py

@ishaanlabs-gg

ishaanlabs-gg commented Jul 1, 2026

Copy link
Copy Markdown
Author

CI note after the first run:

  • The CPython 3.10/3.11/3.12 failures are in BuildTests.test_draft_docs_with_comments_from_user_guide, not in the metadata parser tests touched here. The failure is the same draft-docs/pathspec issue covered separately in Dedent configured pathspec patterns #4155.
  • The PyPy Ubuntu failure happens before MkDocs tests run while installing dependencies: cryptography builds against PyO3 and reports that PyPy 3.9 is below PyO3's minimum supported version.

The local verification for this branch remains focused on the touched metadata behavior:

  • mkdocs.tests.utils.utils_tests.UtilsTests.test_mm_meta_data_ignores_setext_heading
  • full mkdocs.tests.utils.utils_tests
  • compileall and git diff --check

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.

Colon in setext title (with '==' underline) causes incorrect page rendering

1 participant