Files
hapi/web/package.json
T
c87f88f02f fix(web): disable single-dollar inline math in remark-math (#805)
* fix(web/markdown): disable single-dollar inline math in remark-math

Default remark-math configuration treats $...$ as inline LaTeX, which
turns any prose containing two currency amounts (e.g. "save $400 vs the
$200 plan") into a KaTeX block — paragraphs collapse, whitespace is
stripped, the running text is re-rendered as math symbols.

Pass `singleDollarTextMath: false` to remarkMath so single $ is plain
text. Block math `$$...$$` (on its own line) still renders, matching
GitHub-flavored markdown semantics.

Single source of truth: MARKDOWN_PLUGINS is shared by MarkdownText,
Reasoning, and MarkdownRenderer — fix lands in all three surfaces.

Adds 3 regression tests that drive the unified pipeline end-to-end:
prose with multiple "$N" amounts produces no `class="katex"` and no
`<math>` element; `$$...$$` block math still does.

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore(web): declare unified/remark-parse/remark-rehype/hast-util-to-html

The new markdown-text regression test imports these directly to drive the
unified pipeline end-to-end. They were resolving via transitive deps from
remark-math and rehype-katex, which is fragile — a future dep upgrade can
remove the transitives and break the test.

Declare them explicitly under devDependencies. No code change; lockfile
records the same versions that were already installed transitively
(unified@11.0.5, remark-parse@11.0.0, remark-rehype@11.1.2,
hast-util-to-html@9.0.5).

Addresses the HAPI Bot review finding on PR #805.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 13:26:41 +08:00

73 lines
2.4 KiB
JSON

{
"name": "hapi-web",
"private": true,
"version": "0.1.0",
"license": "AGPL-3.0-only",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build && cp dist/index.html dist/404.html",
"typecheck": "tsc --noEmit",
"preview": "vite preview",
"test": "vitest run"
},
"dependencies": {
"@assistant-ui/react": "^0.11.53",
"@assistant-ui/react-markdown": "^0.11.9",
"@elevenlabs/react": "^0.13.0",
"@hapi/protocol": "workspace:*",
"@lobehub/icons": "^5.4.0",
"@radix-ui/react-dialog": "^1.1.15",
"@radix-ui/react-slot": "^1.2.4",
"@shikijs/langs": "^3.20.0",
"@shikijs/themes": "^3.20.0",
"@tanstack/react-query": "^5.90.12",
"@tanstack/react-query-devtools": "^5.91.1",
"@tanstack/react-router": "^1.170.8",
"@tanstack/router-core": "^1.171.6",
"@xterm/addon-canvas": "^0.7.0",
"@xterm/addon-fit": "^0.11.0",
"@xterm/addon-web-links": "^0.12.0",
"@xterm/xterm": "^6.0.0",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"diff": "^8.0.2",
"hast-util-to-jsx-runtime": "^2.3.6",
"katex": "^0.16.45",
"mermaid": "^11.12.0",
"react": "^19.2.3",
"react-dom": "^19.2.3",
"rehype-katex": "^7.0.1",
"remark-breaks": "^4.0.0",
"remark-gfm": "^4.0.1",
"remark-math": "^6.0.0",
"shiki": "^3.20.0",
"socket.io-client": "^4.8.3",
"tailwind-merge": "^3.4.0",
"workbox-expiration": "^7.4.0",
"workbox-precaching": "^7.4.0",
"workbox-routing": "^7.4.0",
"workbox-strategies": "^7.4.0",
"workbox-window": "^7.4.0"
},
"devDependencies": {
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.3.0",
"@types/react": "^19.2.7",
"@types/react-dom": "^19.2.3",
"@tailwindcss/postcss": "^4.1.18",
"@vitejs/plugin-react": "^5.1.2",
"autoprefixer": "^10.4.23",
"hast-util-to-html": "^9.0.5",
"jsdom": "^26.1.0",
"postcss": "^8.5.6",
"remark-parse": "^11.0.0",
"remark-rehype": "^11.1.2",
"tailwindcss": "^4.1.18",
"typescript": "^5.9.3",
"unified": "^11.0.5",
"vite": "^7.3.0",
"vitest": "^4.0.16"
}
}