You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Root cause: pygments==2.20.0 regressed HtmlFormatter so that when filename is None, it calls html.escape() on None and crashes with AttributeError: 'NoneType' object has no attribute 'replace'.
In our MkDocs stack, pymdownx.highlight ends up passing filename=None in the common case (no fence title), so the highlight step fails; pymdownx.superfences then doesn’t replace the fence, and the remaining text is parsed as normal Markdown — which is why ```bash and lines starting with # show up as plain text / headings.
Activity
ttw225 commentedon Apr 3, 2026
Root cause: pygments==2.20.0 regressed HtmlFormatter so that when filename is None, it calls html.escape() on None and crashes with AttributeError: 'NoneType' object has no attribute 'replace'.
In our MkDocs stack, pymdownx.highlight ends up passing filename=None in the common case (no fence title), so the highlight step fails; pymdownx.superfences then doesn’t replace the fence, and the remaining text is parsed as normal Markdown — which is why ```bash and lines starting with # show up as plain text / headings.
Upstream:
Possible mitigation until a Pygments release with the fix is available: pin pygments<2.20 for the docs build (similar approach: jj-vcs/jj#9233).
woile commentedon Apr 3, 2026
Thanks, I'll try this out