Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

A blockquote with U+2028 or U+2029 loops the parser forever

Offen
#30 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

@elwan-l1 arbeitet bereits daran.

Seit 07.10.2026.

  • #31 von @elwan-l1 — offen

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/markdown 1.0.0 (main at d9b5ef7)
  • 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:

  1. /^ {0,3}>\s?/ checks that the line starts a blockquote. >x\u2028 passes.
  2. /^ {0,3}>\s?(.*)$/ reads the rest of the line. >x\u2028 fails.

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

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus TanStack/markdown

Alle Issues in TanStack/markdown

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.