Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#30 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

@elwan-l1 がすでに取り組んでいます。

2026年10月7日 から。

  • #31 @elwan-l1 による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
62/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
nodejs, typescript
領域
backend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
TypeScript
スター
432
フォーク
11
平均マージ
57分
マージ済み PR(30日)
4

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

TanStack/markdown のほかの issue

TanStack/markdown の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。