[BUG] Inline KaTeX math (`$...$`) no longer renders in chat output — only block `$$...$$` works (regression)
已打开 10:56AM - 05 Jun 26 UTC
bug
platform:macos
area:desktop
### Preflight Checklist
- [x] I have searched [existing issues](https://github.…com/anthropics/claude-code/issues?q=is%3Aissue%20state%3Aopen%20label%3Abug) and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
### What's Wrong?
When Claude's reply contains inline math wrapped in single dollar signs (`$...$`), it doesn't render — the raw source is shown instead, dollar signs included. For example, `$q_0$` appears as the literal text "$q_0$" rather than a typeset q-zero.
Block math wrapped in double dollar signs (`$$...$$`) on its own line still renders correctly as typeset KaTeX. So only inline math is broken; block math is fine.
### What Should Happen?
Inline math wrapped in single dollar signs (`$...$`) should render as typeset KaTeX, the same way block math (`$$...$$`) does, with the dollar delimiters hidden. For example, `the start state is $q_0$` should display a typeset q-zero, not the literal text `$q_0$`. Inline math should render the way it did in earlier versions and the way block math still does today.
### Error Messages/Logs
```shell
```
### Steps to Reproduce
1. Ask Claude anything whose answer naturally contains inline math, e.g. "explain a Turing machine's transition function".
2. Claude replies with a sentence containing inline `$...$`, such as: the start state is $q_0$ and the alphabet is $\Sigma = \{0,1\}$.
3. Observe that each inline `$...$` segment shows as raw text with visible dollar signs, not typeset math.
4. For contrast, note that block math on its own line renders correctly:
$$\delta: Q \times \Gamma \to Q \times \Gamma \times \{L,R\}$$
### Claude Model
Opus
### Is this a regression?
Yes, this worked in a previous version
### Last Working Version
_No response_
### Claude Code Version
2.1.156 (Claude Code)
### Platform
Anthropic API
### Operating System
macOS
### Terminal/Shell
Other
### Additional Information
Surface: Claude Code desktop app (macOS). The Terminal/Shell dropdown has no desktop-app option, so it may not reflect the actual surface.
Reproducible 100% of the time this session: every inline `$...$` expression shows raw dollar signs, while every `$$...$$` block renders correctly. Inline single-`$` math rendered fine in earlier versions, so this looks like a regression.
<img width="1049" height="371" alt="Image" src="https://github.com/user-attachments/assets/a62ccbff-f968-4c0f-ad6f-ba3ca994421d" />