fix(#63): indentation in nested mkdocs elements #64
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.
Previously, nested lists within definition bodies were using 2-space increments instead of the expected 4-space increments. This was caused by the normalize_list function skipping processing for any list with level > 1, which incorrectly excluded lists inside definition bodies.
The fix accounts for definition body context by checking context.env["indent_width"] to determine the expected level for top-level lists in the current context. Each definition body adds 2 to the token level and 4 to indent_width, so we calculate the expected top-level and only skip nested lists relative to that level.
This ensures that:
Fixes #63
Related to #58 (partial fix)
Note
Ensure nested lists within definition bodies use 4-space increments by determining top-level via context indent width; update expectations and add regression test.
normalize_listto compute expected top-level fromcontext.env["indent_width"](def bodies add 2 levels / 4 spaces) and only skip lists deeper than that, ensuring 4-space increments for lists inside definition bodies.DEF_LIST_WITH_NESTED_WRAP_EXPECTEDintests/format/test_wrap.pyto match corrected indentation.test_definition_list_nested_indentationto validate 4-space increments for nested lists in definition bodies (including 4/8/12-space checks).Written by Cursor Bugbot for commit 03c0567. This will update automatically on new commits. Configure here.