Skip to content

Fix markdown list hanging indent#826

Open
lwlee2608 wants to merge 6 commits intoanomalyco:mainfrom
lwlee2608:fix/markdown-list-hanging-indent
Open

Fix markdown list hanging indent#826
lwlee2608 wants to merge 6 commits intoanomalyco:mainfrom
lwlee2608:fix/markdown-list-hanging-indent

Conversation

@lwlee2608
Copy link
Copy Markdown

@lwlee2608 lwlee2608 commented Mar 17, 2026

Fix markdown list item continuation line indentation

Problem

When a markdown list item's text wraps to the next line, the continuation lines start at column 0 instead of aligning with the text content after the list marker (e.g. 1. ). This makes wrapped list items hard to read, as the continuation text visually "falls back" to the left edge rather than staying grouped under its list item.

Solution

Align continuation lines with the text that follows the list marker, so wrapped content stays visually connected to its list item.

Why this matters

  • Improves readability of long list items at a glance
  • Makes the list structure clearer - each item reads as a cohesive block
  • Better aesthetic consistency with how most markdown renderers display lists

Before:
image

After:
image

- Include space tokens in markdownRaw before list blocks so preceding
  text blocks retain their trailing blank line
- Flush inline chunks with marginBottom in loose list items so paragraph
  spacing within a list item is preserved
@lwlee2608 lwlee2608 marked this pull request as ready for review March 17, 2026 16:34
@lwlee2608
Copy link
Copy Markdown
Author

Hey @kommander @simonklee @msmps @Hona, just bumping this, mind taking a look when you get a chance?

The broken hanging indent on wrapped list items has been bugging me and this fix has been really useful. Would love to get it merged when you get a chance. Happy to make any changes if needed.

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