Version: @tanstack/markdown 1.0.0 (renderHtml and the React adapter)
Repro
import { renderHtml } from '@tanstack/markdown/html'
renderHtml('5 * 4 * 3 = 60')
renderHtml('a * b * c')
Expected
Under CommonMark's delimiter-run rules, a * followed by whitespace is not left-flanking, so it can't open emphasis. A * preceded by whitespace is not right-flanking, so it can't close emphasis. Both delimiters here have whitespace on both sides, so the text should render literally.
Other parsers agree:
| Input | commonmark.js 0.31.2 | markdown-it 15.0.2 | micromark 4.0.3 | @tanstack/markdown 1.0.0 |
|---|
5 * 4 * 3 = 60 | 5 * 4 * 3 = 60 | 5 * 4 * 3 = 60 | 5 * 4 * 3 = 60 | 5 <em> 4 </em> 3 = 60 |
a * b * c | a * b * c | a * b * c | a * b * c | a <em> b </em> c |
*real italic* | <em>real italic</em> | <em>real italic</em> | <em>real italic</em> | <em>real italic</em> |
Why it matters
Arithmetic and multiplication in plain text (2 * 3, width * height) are common in user-written notes, and they silently turn into italics.
Escaped asterisks (5 \* 4 \* 3) render correctly. Only the flanking check on unescaped delimiters is affected.