Strong ending in nested emphasis (`**bold *italic***`) closes early and leaves a literal `*`
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- markdown, typescript
- Ambito
- backend
Direzione di ricerca
Start at the Markdown emphasis parsing entry point and its tests; the issue does not name specific files, so first locate how delimiter runs are matched. Reproduce the nested and flanking cases from the report and compare output with micromark 4.0.2. Done means all listed inputs produce the expected CommonMark HTML, including the already working reverse nesting case.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
When a strong span ends with a nested emphasis span, so that the closing run is ***, @tanstack/markdown closes the <strong> early and leaves a literal * behind. The reverse case (*outer **inner***) already works.
This is common in real content. MDXEditor's Markdown serializer, for example, writes bold text ending in an italic title exactly as **25 years of *Title***, so content produced by that editor renders with stray asterisks.
Environment
@tanstack/markdown1.0.0,renderHtmlfrom@tanstack/markdown/html. The React adapter shows the same output.- Node 24
- Reference:
micromark4.0.2 (CommonMark)
Reproduction
import { renderHtml } from '@tanstack/markdown/html'
renderHtml('**bold *italic***')
renderHtml('**25 years of *Title***, the debut album.')
renderHtml('***Iceman*, *Maid of Honour* and *Habibti***')
| Input | @tanstack/markdown 1.0.0 |
micromark 4.0.2 (expected) |
|---|---|---|
**bold *italic*** |
<p><strong>bold *italic</strong>*</p> |
<p><strong>bold <em>italic</em></strong></p> |
**25 years of *Title***, the debut album. |
<p><strong>25 years of *Title</strong>*, the debut album.</p> |
<p><strong>25 years of <em>Title</em></strong>, the debut album.</p> |
***Iceman*, *Maid of Honour* and *Habibti*** |
<p><em><strong>Iceman<em>, </em>Maid of Honour<em> and </em>Habibti</strong></em></p> |
<p><strong><em>Iceman</em>, <em>Maid of Honour</em> and <em>Habibti</em></strong></p> |
*outer **inner*** (works) |
<p><em>outer <strong>inner</strong></em></p> |
same |
Related flanking cases (in addition to #28)
#28 covers a * with whitespace on both sides. These two variants also open or close where CommonMark does not:
| Input | @tanstack/markdown 1.0.0 |
micromark 4.0.2 (expected) |
|---|---|---|
**VIP pass **: entry included |
<p><strong>VIP pass </strong>: entry included</p> |
<p>**VIP pass **: entry included</p> |
Seats CSI5* and CSI1*, both sold |
<p>Seats CSI5<em> and CSI1</em>, both sold</p> |
<p>Seats CSI5* and CSI1*, both sold</p> |
- First row: the closing
**is preceded by whitespace, so it is not right-flanking. - Second row: the first
*is followed by whitespace, so it is not left-flanking.
Context
We compared @tanstack/markdown against a corpus of about 4,000 real Markdown documents. These emphasis cases account for most of the visible differences. They are the only thing blocking us from adopting it.
- Lingua principale
- TypeScript
- Stelle
- 432
- Fork
- 11
- Merge medio
- 57m
- PR unite (30g)
- 4
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di TanStack/markdown
-
A blockquote with U+2028 or U+2029 loops the parser foreverForse già presa @elwan-l1 l’ha presa 18 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 62/100
-
Difficoltà 3/5 Mezza giornata Idoneità per principianti 70/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
Tutte le issue di TanStack/markdown
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
openremote/openremote#3487 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
coollabsio/jean#867 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
ehmpathy/rhachet-roles-bhuild#616 ·
I maintainer di solito rispondono entro 1 giorno
-
📘 Docs supabase/cli
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 1 giorno
-
bug(cli): theme file home-directory check uses startsWith (sibling dirs pass, Windows casing fails)Apertaarea/core kind/bug priority/p2 status/bot-triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
google-gemini/gemini-cli#29955 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno