Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Asterisks surrounded by spaces are parsed as emphasis (`a * b * c` → `a <em> b </em> c`)

Aperta
#28 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
markdown, typescript
Ambito
content

Direzione di ricerca

Start by reproducing with renderHtml('a * b * c') from the @tanstack/markdown/html entry point. The fault is in how unescaped * delimiters are classified as left- or right-flanking when whitespace sits on both sides, so look at the inline emphasis delimiter handling in the parser that renderHtml calls. Done means both repro inputs render as literal asterisks, real italic still becomes emphasis, and escaped asterisks are unchanged.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Version: @tanstack/markdown 1.0.0 (renderHtml and the React adapter)

Repro

import { renderHtml } from '@tanstack/markdown/html'

renderHtml('5 * 4 * 3 = 60')
// actual:   <p>5 <em> 4 </em> 3 = 60</p>
// expected: <p>5 * 4 * 3 = 60</p>

renderHtml('a * b * c')
// actual:   <p>a <em> b </em> c</p>
// expected: <p>a * b * c</p>

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.

Lingua principale
TypeScript
Stelle
432
Fork
11
Merge medio
57m
PR unite (30g)
4

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di TanStack/markdown

Tutte le issue di TanStack/markdown

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.