Skip to content

rehype-katex: update katex - #122

Open
Vondry wants to merge 1 commit into
remarkjs:mainfrom
Vondry:rehype-katex-katex-0.19
Open

Vondry wants to merge 1 commit into
remarkjs:mainfrom
Vondry:rehype-katex-katex-0.19

Conversation

@Vondry

@Vondry Vondry commented Oct 14, 2026 •

Copy link
Copy Markdown

Initial checklist

  • I read the support docs
  • I read the contributing guide
  • I agree to follow the code of conduct
  • I searched issues and discussions and couldn’t find anything or linked relevant results below
  • I made sure the docs are up to date
  • I included tests (or that’s not needed)

Description of changes

Updates katex in rehype-katex from ^0.16.0 to ^0.19.0. katex below 0.18.2 is affected by GHSA-238p-pmpm-9mq7, and the current range keeps dependents from getting the fix without an override.

Closes GH-121.

  • @types/katex is removed: katex ships its own types
  • the readme CSS links point to katex@0.19.0: KaTeX 0.18 prefixed a number of internal class names (base → katex-base and so on), so markup from this version needs the matching stylesheet
  • the “non-parse errors” test used \begin{split}\end{{split}}, which KaTeX now reports as a ParseError (fix(environment): report invalid environment names as ParseError KaTeX/KaTeX#4256), so it no longer reached the fallback branch; it now uses \begin{array}{{c}}…, which still throws a plain Error on both 0.16 and 0.19

The lib/ code needs no change: it only uses renderToString, and the options it passes (throwOnError, strict: 'ignore') behave the same.

Because of the class name change I think this is a breaking change for users who load KaTeX’s CSS themselves, so it probably warrants a major. This matches the review on micromark/micromark-extension-math#14, which does the same update for the package remark-math uses.

Note: locally (Node 24) the “should handle errors, support errorColor” test fails on a VFileMessage shape difference; it fails the same way on main without this change, so it is unrelated.

@github-actions github-actions Bot added the 👋 phase/new Post is being triaged automatically label Oct 14, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot added 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Oct 14, 2026
neilsh added a commit to neilsh/stunt-reel that referenced this pull request Nov 15, 2026
rehype-katex 7 still declares katex ^0.16.0 while mermaid takes ^0.18.0,
so two copies coexisted and the 0.16.47 pin left the renderer on a
release without the advisory fixes. The override gives the tree one
KaTeX, 0.18.11, inside mermaid's range; the direct pin keeps the
stylesheet the same version. Renovate now allows below 0.19. Drop the
override once remarkjs/remark-math#122 ships. The math spike
(work/2026-11/576_research-site/math-spike.md on
claude/spike-site-math-b43fe3) has the evidence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
neilsh added a commit to neilsh/stunt-reel that referenced this pull request Nov 15, 2026
* docs(work): spec for publishing research/ as a Pages site (#576)

Starlight over a Python prep script so research/ stays the only copy of
the notes; MkDocs Material is past its maintenance window and Zensical's
hooks are partial. The local gate is left unchanged so research-only
changes never need Bun.

Fresh-review: two subagent passes over spec.md drafts, checked against NOTICE.md, gate.py, ADR 0038, renovate.jsonc, ci.yml, the python doc-tooling modules and research/ link and figure counts
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(work): implementation plan for the research site (#576)

Six tasks run as subagent dispatches: Sonnet for the Python prep step,
the Starlight build and the prose pages; Haiku for the browser look and
the Pages workflow, which the plan nearly transcribes; one Opus review of
the finished branch, per docs/harness.md. configure-pages is left out
because Astro's own Pages workflow doesn't need it and it would need a
pages permission in the build job.

Fresh-review: a Sonnet subagent read plan.md against spec.md, AGENTS.md, docs/harness.md § Policy, markdown_links.py, frontmatter.py, knowledge_map.py, gate.py, mise.toml, ci.yml, renovate.jsonc, NOTICE.md and docs/SPEC.md § 2.4, and recounted the notes, math, Mermaid and path figures under research/
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(site): page URLs and link rewriting for the research site (#576)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* feat(site): title, description and source link for each site page (#576)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* feat(site): prepare the research site's content from site/published.toml (#576)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* feat(site): Starlight build of the research site (#576)

Bun 1.4.4 is pinned in mise.toml and mise.lock; site/ is a Bun project with
exact versions. `mise run site` builds site/dist, `mise run site-serve`
previews it.

Differences from the plan's config, from the installed packages:
- Astro 7 uses the Satteri Markdown processor by default; the remark/rehype
  plugins need @astrojs/markdown-remark (added, exact). Astro still accepts
  markdown.remarkPlugins/rehypePlugins but warns they are deprecated in
  favour of unified({...}); kept as the plan wrote them.
- Starlight 0.43 removed a sidebar group's top-level `autogenerate`; the
  prep step now writes {label, items: [{autogenerate}]} (test updated).
- starlight-links-validator drops only a lower-case `index`, so INDEX.md
  was unreachable at its folder URL; the prep step lower-cases written file
  names (test added). URLs are unchanged.
- astro-mermaid 2.2.0 and starlight-links-validator 0.27.0 take the plan's
  usage as is (mermaid() before starlight, validator in `plugins`); the
  social shape and the `page.editLink` i18n key match too.
- test_markdown_links_resolve skips the gitignored generated pages
  (site/src/content/docs/), whose site-absolute URLs the validator checks.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix(site): keep a leading code span in page titles; label hand-written pages by title (#576)

page_text matched the heading on the code-blanked line, where the blanked span
is absorbed by the whitespace after "#", so "# `PLAYONE.EXE`: X" became ": X"
(22 pages). The title now comes from the original line. A page whose front
matter sets title: also uses it as its sidebar label instead of the file stem.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* ci(site): build the research site on PRs and deploy it to Pages from main (#576)

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>

* docs(site): landing page and reading guide; comparison-only screenshots in NOTICE (#576)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix(site): normalise display math and fail the build on a KaTeX error (#576)

micromark reads the remainder of a `$$` line as fence meta, so a multi-line block opened with
`$$M = ...` swallowed the rest of coordinates-and-units and one-line `$$x$$` rendered inline.
The prep step now puts each fence outside code on its own line, and a rehype plugin after
rehype-katex throws on any message it recorded, so a bad formula cannot ship as a red span.

Also: the unified() markdown processor replaces the deprecated plugin keys; a repo-root link
opens the tree; the CLI and prepare name the file for IO and TOML errors; two sources writing
one path (case-insensitively) raise; backslashes in published.toml paths are refused; a file
section's label is its page title; descriptions lose Markdown; generated doc dirs get their
own constant in the link test.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* docs(site): widen the licence and tag wording to match their sources (#576)

reading.md now excepts cited community research and captured game frames from CC BY 4.0, as
research/README.md, README.md and NOTICE.md do, gives [Superseded] a line and words the tags as
SPEC section 2.4 does. NOTICE.md's comparison-sheet bullet covers the other layouts in work/.
research/README.md tells note authors the notes are published and what the build needs.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* chore(site): group the site's npm packages in Renovate and bound the Pages jobs (#576)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* docs(research): say when a note's file name breaks the site build (#576)

page_url only checks names it is asked to link, so an unlinked note with
a bad name still builds; the line now says the build fails when a
published page links to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(work): link PR #578; Pages goes on before the first merge (#576)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(site): pin katex to the 0.16 rehype-katex renders with (#576)

rehype-katex 7 renders with its own katex 0.16.47, which emits .sizing
classes; the 0.19.1 stylesheet the site loaded styles .katex-sizing, so
script-size math lost its sizing. Renovate now keeps katex below 0.17.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(site): force one KaTeX 0.18.11 through a Bun override (#576)

rehype-katex 7 still declares katex ^0.16.0 while mermaid takes ^0.18.0,
so two copies coexisted and the 0.16.47 pin left the renderer on a
release without the advisory fixes. The override gives the tree one
KaTeX, 0.18.11, inside mermaid's range; the direct pin keeps the
stylesheet the same version. Renovate now allows below 0.19. Drop the
override once remarkjs/remark-math#122 ships. The math spike
(work/2026-11/576_research-site/math-spike.md on
claude/spike-site-math-b43fe3) has the evidence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🤞 phase/open Post is being triaged manually

Development

Successfully merging this pull request may close these issues.

rehype-katex: allow katex >=0.18.2 (GHSA-238p-pmpm-9mq7)

1 participant