Skip to content

fix(docs): upgrade pymdown-extensions to 10.21.3 for pygments 2.20.0 compat#514

Merged
wphillipmoore merged 2 commits into
developfrom
feature/512-docs-build
Jun 2, 2026
Merged

fix(docs): upgrade pymdown-extensions to 10.21.3 for pygments 2.20.0 compat#514
wphillipmoore merged 2 commits into
developfrom
feature/512-docs-build

Conversation

@wphillipmoore-vergil-agent

@wphillipmoore-vergil-agent wphillipmoore-vergil-agent Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Fixes the CD docs build crash (mkdocstrings source highlighting) surfaced once the item-7 CD fix (#511) un-blocked the docs job.

Root cause: pymdown-extensions < 10.21.3 passes filename=None into pygments' HtmlFormatter; pygments >= 2.20.0 calls html.escape() on it and crashes (AttributeError: 'NoneType' ... 'replace'). pymdown-extensions 10.21.3 fixes the filename handling.

Fix: floor pymdown-extensions>=10.21.3 and relock; stay on pygments 2.20.0, which also carries the CVE-2026-4539 fix. No pinned-down dependency, so no tech debt (pinning pygments<2.20 was a dead end — 2.19.2 fails pip-audit on that CVE).

Validated locally: full CD docs sequence (vrg-docs-stage + vrg-docs-patch-nav + mkdocs build) builds clean, and vrg-validate (incl. pip-audit) passes. Closes #512. Supersedes the tech-debt issue #513 (no longer needed). Part of epic mq-rest-admin-project/.github#14.

…ht crash

The CD docs build crashed in mkdocstrings source highlighting:
html.escape('NoneType') via pygments 2.20.0's HtmlFormatter, which
escapes the 'filename' option (None for mkdocstrings source blocks)
without guarding None. Pin pygments < 2.20 (resolves to 2.19.2) in the
docs group to restore the build.

Validated locally: full CD docs sequence (vrg-docs-stage +
vrg-docs-patch-nav + mkdocs build) completes cleanly.

The pin is technical debt; revisit/unpin tracked in #513 (records the
broken version and how to validate a fix). Refs #512.
Supersedes the previous pygments<2.20 pin on this branch. Pinning
pygments down was a dead end: pygments 2.19.2 carries CVE-2026-4539
(fixed in 2.20.0), so pip-audit blocks it.

The actual incompatibility is pymdown-extensions < 10.21.3 passing
filename=None into pygments' HtmlFormatter, which crashes mkdocstrings
source highlighting on pygments >= 2.20.0. pymdown-extensions 10.21.3
fixes that. So: stay on pygments 2.20.0 (CVE-safe) and floor
pymdown-extensions >= 10.21.3.

Result: docs build is green AND audit is clean; no pinned-down
dependency, so no tech debt (closes the need for #513). Validated locally
via the full CD docs sequence (stage + patch-nav + mkdocs build) and
vrg-validate (incl. pip-audit). Refs #512.
@wphillipmoore-vergil-agent wphillipmoore-vergil-agent Bot changed the title fix(docs): pin pygments<2.20 to fix mkdocstrings source-highlight crash fix(docs): upgrade pymdown-extensions to 10.21.3 for pygments 2.20.0 compat Jun 2, 2026
@wphillipmoore wphillipmoore merged commit d7e10b5 into develop Jun 2, 2026
24 checks passed
@wphillipmoore wphillipmoore deleted the feature/512-docs-build branch June 2, 2026 12:07
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.

fix(docs): CD docs build fails in mkdocstrings source highlight on api/auth.md

1 participant