Skip to content

fix: list continuation & crlf bug#777

Merged
quantizor merged 5 commits intomainfrom
bugfixes
Jan 10, 2026
Merged

fix: list continuation & crlf bug#777
quantizor merged 5 commits intomainfrom
bugfixes

Conversation

@quantizor
Copy link
Copy Markdown
Owner

@quantizor quantizor commented Jan 10, 2026

Note

Ensures consistent parsing with Windows-style CRLF inputs and correct block boundaries around lists.

  • Add normalizeCRLF and adjust findLineEnd/skipToNextLine; treat CRLF as a single newline and preserve lone CR
  • Update paragraph, setext heading, code fence/indented code, HTML block/comment, frontmatter, and ref collection paths to use normalized/newline-aware traversal
  • Fix list lazy continuation to stop across blank lines, preventing nested lists from absorbing the following paragraph
  • Harden reference definition parsing (quoted/parenthesized titles, block-start detection) and footnote end scanning with CRLF-aware blank line detection
  • Add extensive tests for CRLF equivalence across features and for the nested-list paragraph case; refresh parser metrics baseline

Written by Cursor Bugbot for commit 1e98d91. This will update automatically on new commits. Configure here.

Paragraphs following nested lists after blank lines were incorrectly being
absorbed into the nested list item instead of being parsed as separate blocks.
This fix ensures paragraphs are correctly separated from nested lists per
CommonMark specification.
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jan 10, 2026

🦋 Changeset detected

Latest commit: 1e98d91

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

This PR includes changesets to release 1 package
Name Type
markdown-to-jsx Patch

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

@quantizor quantizor force-pushed the bugfixes branch 2 times, most recently from bc329e9 to 8782c1a Compare January 10, 2026 05:41
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on February 7

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Comment thread src/parse.ts
Lists and other markdown structures were incorrectly parsed when input had
CRLF line endings. This fix ensures CRLF line endings are properly handled
as line boundaries without requiring input normalization.
Extract shared utilities to reduce code duplication in parseRefContent and parseFootnoteContent. New helpers (isBlockStartAt, isTitleDelimiter, parseQuotedTitle, parseParenTitle, scanFootnoteEnd) consolidate repeated patterns across reference and footnote parsing.

- parseRefContent: 507→383 lines (-24%)
- parseFootnoteContent: 185→123 lines (-34%)
- Net reduction: 53 lines

All tests passing, performance within 5% of baseline.
Comment thread src/parse.ts
- parseQuotedTitle: detect CRLF blank lines to reject invalid titles
- parseParenTitle: detect CRLF blank lines to reject invalid titles
- scanFootnoteEnd: detect CRLF blank lines to stop absorbing content
- Add CHAR_PAREN_OPEN/CLOSE constants
- Remove unused scanToBlankLine function
@quantizor quantizor merged commit 282affe into main Jan 10, 2026
8 checks passed
@quantizor quantizor deleted the bugfixes branch January 10, 2026 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant