Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 13, 2026

  • Understand the issue: inconsistent spacing between nodes depending on indentation in list items
  • Identify the root cause: appendListContinuation was called with addNewline: false for lines with nextIndent === baseIndent
  • Fix: Change addNewline from false to true in parse.ts for continuation lines at base indentation
  • Add inline snapshot tests for the specific scenarios from issue Inconsistent spacing between nodes depending on indentation #793
  • Update existing snapshot test that expected the old (buggy) behavior
  • Run full test suite to ensure no regression (2033 tests pass)
  • Rebuild the site
  • Add changeset
  • Flatten tests and add issue number (Inconsistent spacing between nodes depending on indentation #793) to test names
Original prompt

This section details on the original issue you should resolve

<issue_title>Inconsistent spacing between nodes depending on indentation</issue_title>
<issue_description>Markdown

- Unordered list.
No prefixed spaces.

- Unordered list.
  Prefixed with spaces.

- Unordered list.
  - Nested list.
No prefixed spaces.

- Unordered list.
  - Nested list.
 Prefixed spaces less than the nested list.

- Unordered list.
  - Nested list.
  Prefixed spaces equal to the nested list.
  And again.

- Unordered list.
  - Nested list.
Prefixed spaces not equal to the nested list.
  But this line's are.

- Unordered list.
  - Nested list.
    Prefixed spaces greater than the nested list.

Result

Image

Expected

Image

Note: This also happens for ordered lists. Running it through just the parser, it seems like it is not creating a node for the newline when the indentation matches the list item's indentation.

Image

<agent_instructions>Rebuild the site when you're done and don't forget a changeset if there are code changes.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@quantizor Thank you, will take a look

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.


Note

Fix list item spacing

  • Ensures continuation lines indented to the nested list marker emit newline nodes instead of being concatenated, fixing missing line breaks in rendered lists
  • Ships as a patch release via changeset (.changeset/fix-list-spacing.md)

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

@changeset-bot
Copy link

changeset-bot bot commented Jan 13, 2026

🦋 Changeset detected

Latest commit: 8cf93a7

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

Copilot AI and others added 2 commits January 13, 2026 03:26
…tion

Co-authored-by: quantizor <570070+quantizor@users.noreply.github.com>
Co-authored-by: quantizor <570070+quantizor@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix inconsistent spacing between nodes with indentation Fix missing newlines between list item continuation lines at base indentation Jan 13, 2026
Copilot AI requested a review from quantizor January 13, 2026 03:31
@quantizor
Copy link
Owner

@copilot flatten the tests and fix noted issue number, we don't need excessive describe blocks

@quantizor quantizor marked this pull request as ready for review January 13, 2026 03:32
Co-authored-by: quantizor <570070+quantizor@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 13, 2026

@copilot flatten the tests and fix noted issue number, we don't need excessive describe blocks

Done in 8cf93a7. Removed the describe wrapper and added (#793) to each test name.

@quantizor quantizor merged commit 4252da4 into main Jan 13, 2026
7 checks passed
@quantizor quantizor deleted the copilot/fix-inconsistent-spacing-nodes branch January 13, 2026 03:40
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.

Inconsistent spacing between nodes depending on indentation

2 participants