Skip to content
Source
Sign inSign up
TanStack/markdown

Fix parser to stop looping forever on U+2028 or U+2029 in blockquotes #31

Mergedelwan-l1(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/31/headmerged by tannerlinsley

Fix blockquotes containing U+2028 or U+2029 so parsing consumes the line and finishes. Elwan's original fix, regression and patch changeset are preserved, refreshed against Markdown 1.1.0.

Fixes #30

AI review notes: Exact current base d671a2e and composed head 91dba73 were independently checked. All 23 selective and complete namespace entries were measured with the same Node24/compiler/compression. Only 11 necessary ceiling updates were made, with maximum increases of 1 minified byte, 3 gzip bytes and 13 Brotli bytes per affected entry, within the owner's narrow acceptance for this fix. Separately imported extension ceilings stay unchanged.

The actual local verify script passes 338 tests, types, build, 28 documentation pages, six skills, conformance and packaging. The same 403 of 652 CommonMark examples pass. Exact-head CI 41360891982 also passes, including the external corpus, packed Node 22/24 and React 18/19 consumers and all six streaming-browser combinations.

The exact released 1.1.0 baseline times out on the reported quote input, and six finite Unicode cases pass with HTML/React/Octane, core/docs extensions, serialized AST and URL policy. Two matched repetitions and two fresh-process repeats compare every completed progressive update. An initially noisy small-document result did not repeat with isolated processes. No material workload regression was demonstrated, and no general speedup or allocation claim is made. Retained heap/RSS controls remain noisy.

Merged normally as e4112c5. Release PR #35 targets 1.1.1 and is running normal CI. Publication and downloaded-artifact verification are still pending.

    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review in Change Stack →

      No actionable comments were generated in the recent review.

      Recent review info
      Run configuration
      • Source mode: Auto
      • Repository: Unavailable
      • Branch: Unavailable
      • File: No configuration file from this repository applied
      • Commit: Unavailable
      • Layers: defaults
      • Review profile: CHILL
      • Plan: Advanced
      • Run ID: 3d171151-8fa8-4df4-8218-48fbfcc900dc
      Commits

      Reviewing files that changed from the base of the PR and between d0a5dab3068d11bd407df764cabcd332cdb3600b and 91dba73666af55c874bc4c16d56810258385911b.

      Files selected for processing: 1
      • tests/bundle-size.test.ts

      Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

      Walkthrough

      The blockquote parser now uses dot-all matching. A regression test covers U+2028 and U+2029 separators, bundle-size ceilings are updated, and a patch changeset is added.

      Changes: Blockquote parser fix

      Layer / File(s)Summary
      Update blockquote matching and validate line separators
      src/parser.ts, tests/audit-regressions.test.tsx, tests/bundle-size.test.ts, .changeset/blockquote-line-separators.md
      parseBlockquote uses dot-all matching. The regression test checks rendering with U+2028 and U+2029 under a timeout. Bundle-size ceilings and the patch changeset are also updated.

      Estimated code review effort: 2 (Simple) | ~10 minutes

      Change: Bug fix · Severity of issue fixed: Medium

      Suggested reviewers: tannerlinsley

      Merge Risk: Minimal · up to 91dba

      No actionable merge-blocking risk is identified. The bundle-size ceiling adjustments are consistent with the reported parser fix; merge readiness remains subject to normal checks.

      Pre-merge checks: Passed 5
      Check nameStatusExplanation
      Description CheckPassedCheck skipped - CodeRabbit’s high-level summary is enabled.
      Title checkPassedThe title clearly and concisely identifies the main change: preventing infinite parser loops for U+2028 or U+2029 in blockquotes.
      Linked Issues checkPassedThe change in src/parser.ts adds the s flag to the second parseBlockquote regex. The regex now consumes U+2028 and U+2029, so the parser advances past affected blockquote lines. `tests/audit-reg…
      Out of Scope Changes checkPassedThe regression test directly verifies issue #30. The bundle-size budget updates account for the parser change. The changeset records the package patch release. No unrelated changes are shown in the pu…
      Docstring CoveragePassedDocstring coverage is inconclusive: files from earlier reviews still need to be rechecked within the check's analysis limits. Not blocking.
      Full details: Linked Issues check

      Explanation

      The change in src/parser.ts adds the s flag to the second parseBlockquote regex. The regex now consumes U+2028 and U+2029, so the parser advances past affected blockquote lines. tests/audit-regressions.test.tsx covers both separators and runs in a subprocess with a timeout. This satisfies the coding requirement in issue #30.

      Full details: Out of Scope Changes check

      Explanation

      The regression test directly verifies issue #30. The bundle-size budget updates account for the parser change. The changeset records the package patch release. No unrelated changes are shown in the pull request diff.

      Finishing Touches
      Generate unit tests (beta)
      • Create a new PR
      • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      Share
    2. changeset-bot[bot](GitHub profile, opens in a new tab)commented

      🦋 Changeset detected

      Latest commit: 91dba73666af55c874bc4c16d56810258385911b

      The changes in this PR will be included in the next version bump.

      This PR includes changesets to release 1 package
      NameType
      @tanstack/markdownPatch

      Not sure what this means? Click here to learn what changesets are.

      Click here if you're a maintainer who wants to add another changeset to this PR

    3. tannerlinsley merged thise4112c5

    4. tannerlinsley closed this

Sign in to join this conversation.