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

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

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

@elwan-l1 ci sta già lavorando.

Dal 7/10/2026.

  • #31 di @elwan-l1 — aperta

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/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 >.

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.