Skip to content

fix(deps): clear npm audit for source-map-js and mermaid's katex - #960

Merged
PathGao merged 1 commit into
masterfrom
fix/audit-source-map-js
Oct 7, 2026
Merged

PathGao merged 1 commit into
masterfrom
fix/audit-source-map-js

Conversation

@PathGao

@PathGao PathGao commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

What this is

npm audit fails on master with two new advisories, so every PR's test job is red (seen on #959).

Mechanism

mermaid 11 (and 12.1.0, the latest) declares katex ^0.16.47, and the fix exists only from 0.18.2, with no patched 0.16 release. No version satisfies both, so npm audit fix leaves it and --force would downgrade mermaid to 10.8.0. An override points mermaid at $katex, the 0.18.9 Markpad already depends on, so there is one copy instead of two.

mermaid calls a single katex function, renderToString(tex, { throwOnError, displayMode, output }), which 0.18 keeps.

Scope

Math in mermaid labels does not render in Markpad today, with or without this change: htmlLabels: false draws flowchart labels as SVG text, so $$…$$ shows as written, and a sequence diagram's math message comes out blank. Left alone here.

Verification

macOS 27.0.1. npm audit: 0 vulnerabilities. npm ls katex: mermaid's copy is deduped to 0.18.9. npm run check 0 errors, npm test 1112 pass, npx vitest run 492 pass. In release builds before and after, a flowchart and a sequence diagram with $$…$$ labels render the same.

source-map-js 1.2.1 has a high advisory (GHSA-68fv-2mgg-jv7q); the lockfile
moves to 1.2.2. mermaid requires katex ^0.16.47, and the KaTeX advisory
(GHSA-238p-pmpm-9mq7) is fixed only from 0.18.2, so an override points
mermaid at the katex 0.18.9 Markpad already depends on.
@PathGao
PathGao merged commit e92a217 into master Oct 7, 2026
4 checks passed
@PathGao
PathGao deleted the fix/audit-source-map-js branch October 7, 2026 07:00
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.

1 participant