MoonshotAI / MoonshotAI/kimi-code
feat(web): enable \(...\) as inline math delimiter in kimi web
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.5k
- Forks
- 1.2k
- Avg merge
- 11h 53m
- Merged PRs (30d)
- 350
Description
What feature would you like to see?
Enable \(...\) as an inline math delimiter in kimi web.
Currently, apps/kimi-web/src/components/chat/Markdown.vue (disableInlineMath) disables markdown-it's inline math rule entirely, so no inline math renders at all — $...$, \(...\), and mid-paragraph $$...$$ all show as raw source. Only standalone $$...$$ blocks are rendered.
\(...\) is the safe way to bring inline math back:
- It contains no
$, so literal text like$5,$PATH,$HOME/bin— the original reason inline math was disabled — stays completely untouched. - markstream's inline math rule already recognizes
\(...\)(markstream-vue/packages/markdown-parser/src/plugins/math.ts); the current blanketdisable('math')kills it together with$...$. Re-enabling just the\(...\)branch is enough.
Inline math is heavily used in technical and scientific answers, and models default to it — so a large fraction of math output currently degrades to raw LaTeX source on the web. The VSCode extension webview already renders inline math (remark-math + rehype-katex), so the same answer also renders inconsistently across surfaces.
Additional information
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in apps/kimi-web/src/components/chat/Markdown.vue at disableInlineMath, then read markstream-vue/packages/markdown-parser/src/plugins/math.ts to understand its existing (...) recognition. The change is complete when escaped-parenthesis inline math renders in kimi web while literal text such as $5 and $PATH remains untouched, without restoring other dollar-based inline forms.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 75/100