fix(lists): expand tabs in the indentation to four-column stops - #67
Merged
Merged
Conversation
Everything that measures indentation counts spaces, so a list item indented with a tab was one column deep instead of four. A tab-indented item under another item did not nest: its continuation lines hung from the parent's column, and the tab itself reached the buffer, where 'tabstop' (8 by default) pushed the marker further right than its text's hanging indent assumed. render_document now expands tabs in each line's leading whitespace before anything measures it, with tab stops every four columns as CommonMark specifies, so `\t- item` renders exactly as ` - item` does. Fenced code is left alone, since its tabs are content. tests/list_indent_test.lua gains a case for a tab-indented nested item, a tab after spaces, and a tab inside fenced code. Four of its assertions fail before this change. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
denny0223
pushed a commit
to denny0223/md-render.nvim
that referenced
this pull request
Sep 24, 2026
…hinus#67) Everything that measures indentation counts spaces, so a list item indented with a tab was one column deep instead of four. A tab-indented item under another item did not nest: its continuation lines hung from the parent's column, and the tab itself reached the buffer, where 'tabstop' (8 by default) pushed the marker further right than its text's hanging indent assumed. render_document now expands tabs in each line's leading whitespace before anything measures it, with tab stops every four columns as CommonMark specifies, so `\t- item` renders exactly as ` - item` does. Fenced code is left alone, since its tabs are content. tests/list_indent_test.lua gains a case for a tab-indented nested item, a tab after spaces, and a tab inside fenced code. Four of its assertions fail before this change. Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> (cherry picked from commit 865dcce)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Everything that measures indentation counts spaces, so a list item indented with a tab was one column deep instead of four. A tab-indented item under another item did not nest:
'tabstop'(8 by default) pushed the marker further right than the hanging indent assumed.The fix
render_documentexpands tabs in each line's leading whitespace before anything measures it, with tab stops every four columns as CommonMark specifies.\t- itemnow renders exactly as- itemdoes, and\tstops at column 4. Fenced code is left alone, since its tabs are content.Tests
tests/list_indent_test.luagains Test 10:Four of these assertions fail without the fix.
make testpasses.🤖 Generated with Claude Code