A blockquote with U+2028 or U+2029 loops the parser forever
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 62/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- nodejs, typescript
- Ambito
- backend
Direzione di ricerca
The bug lives in parseBlockquote in src/parser.ts, where the two per-line regexes disagree about U+2028 and U+2029. Reproduce with renderHtml on the input '>\u2028' and check that it hangs. Done when the parser consumes the line and the input returns a blockquote, with a regression test added for both separator characters.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
The parser gets stuck in an infinite loop when a blockquote line contains U+2028 (line separator) or U+2029 (paragraph separator).
Environment
@tanstack/markdown1.0.0 (mainatd9b5ef7)- Node v26.8.1
- The bug is in the parser so every renderer is affected.
Steps to reproduce
import { renderHtml } from '@tanstack/markdown/html'
renderHtml('>x') // returns
renderHtml('>x\u2028') // loops indefinitely
renderHtml('>x\u2029') // loops indefinitely
Root cause
parseBlockquote checks each line twice:
/^ {0,3}>\s?/checks that the line starts a blockquote.>x\u2028passes./^ {0,3}>\s?(.*)$/reads the rest of the line.>x\u2028fails.
The second check fails because JavaScript treats U+2028 and U+2029 as line breaks and . does not match a line break. So (.*) stops before the character and $ cannot match.
When the second check fails the loop exits before moving to the next line. The parser returns an empty blockquote without consuming the line. Then it tries the same line again forever.
Any line that starts with > and contains one of these characters triggers the bug. One exception: >\u2028x works because \s? takes the character right after >.
- 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
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/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
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
outline/outline#14348 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: Agent import retains quotes in .env API keys followed by inline commentsForse già presa @yxr-2025 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
elie222/rakazo#2322 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
awslabs/visual-asset-management-system#804 ·
I maintainer di solito rispondono entro 1 giorno
-
用户目录有单引号时,热加载时YAML解析崩溃Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
dsh-market/dsh-market#1027 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno