A blockquote with U+2028 or U+2029 loops the parser forever
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 62/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- nodejs, typescript
- Bereich
- backend
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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 >.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 432
- Forks
- 11
- Ø Merge
- 57 Min.
- Gemergte PRs (30 T.)
- 4
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus TanStack/markdown
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
-
Schwierigkeit 3/5 Ein halber Tag Anfängerfreundlichkeit 70/100
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 55/100
Alle Issues in TanStack/markdown
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
openremote/openremote#3487 · 1 Kommentar ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
coollabsio/jean#867 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
ehmpathy/rhachet-roles-bhuild#616 ·
Maintainer antworten meist innerhalb von 1 Tag
-
📘 Docs supabase/cli
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 83/100
Maintainer antworten meist innerhalb von 1 Tag
-
bug(cli): theme file home-directory check uses startsWith (sibling dirs pass, Windows casing fails)Offenarea/core kind/bug priority/p2 status/bot-triaged
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 79/100
google-gemini/gemini-cli#29955 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag