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
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