Skip to content

Pin Pygments below 2.20 to unbreak mkdocs build - #27

Merged
nicoloesch merged 1 commit into
mainfrom
fix-docs
Aug 3, 2026
Merged

Pin Pygments below 2.20 to unbreak mkdocs build#27
nicoloesch merged 1 commit into
mainfrom
fix-docs

Conversation

@nicoloesch

Copy link
Copy Markdown
Collaborator

https://github.com/AustralianCancerDataNetwork/orm-loader/actions/runs/30783414546/job/91592311808

Summary:

  • mkdocs gh-deploy/mkdocs build fails on docs/tables/mat_view.md with AttributeError: 'NoneType' object has no attribute 'replace' -> Link to failing workflow
  • Root cause is upstream: Pygments 2.20.0's HtmlFormatter.__init__ does html.escape(options.get('filename', '')), but pymdown-extensions always explicitly passes filename=title if not inline else "". For any fenced code block without an explicit title= option (i.e. virtually all of them), title is None, so pygments receives filename=None and crashes on .replace(). - Filed and fixed upstream (pygments/pygments#3078) but not yet in a released version
    • 2.20.0 is still latest on PyPI.

Fix

  • tighten the pin to Pygments>=2.19.1,<2.20 (matches pymdown-extensions' own floor) until a 2.20.1 release ships the fix, then remove the ceiling.

@nicoloesch nicoloesch added the chore Maintenance, refactoring, or housekeeping. Excluded from changelog, no version bump. label Aug 3, 2026
@nicoloesch
nicoloesch requested a review from gkennos August 3, 2026 04:35
@nicoloesch
nicoloesch merged commit ace07d0 into main Aug 3, 2026
3 of 4 checks passed
@nicoloesch
nicoloesch deleted the fix-docs branch August 3, 2026 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance, refactoring, or housekeeping. Excluded from changelog, no version bump.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants