🐛 FIX: Nested field lists incorrectly nesting inside parent containers by chrisjsewell · Pull Request #139 · executablebooks/mdit-py-plugins · GitHub
Skip to content

🐛 FIX: Nested field lists incorrectly nesting inside parent containers#139

Merged
chrisjsewell merged 1 commit into
masterfrom
fix-field-list
May 13, 2026
Merged

🐛 FIX: Nested field lists incorrectly nesting inside parent containers#139
chrisjsewell merged 1 commit into
masterfrom
fix-field-list

Conversation

@chrisjsewell

Copy link
Copy Markdown
Member

Field lists inside list items (or other indented containers) would recursively nest each field inside the previous one, instead of being siblings. The body-indent scanner compared tShift against 0, which doesn't account for the parent block's indentation (blkIndent).

Changed the check to state.tShift[_line] <= state.blkIndent so the comparison is relative to the containing block's indent.

Fixes executablebooks/MyST-Parser#1108

Field lists inside list items (or other indented containers) would
recursively nest each field inside the previous one, instead of being
siblings. The body-indent scanner compared `tShift` against 0, which
doesn't account for the parent block's indentation (`blkIndent`).

Changed the check to `state.tShift[_line] <= state.blkIndent` so the
comparison is relative to the containing block's indent.

Fixes executablebooks/MyST-Parser#1108
@codecov

codecov Bot commented May 13, 2026

Copy link
Copy Markdown

@chrisjsewell chrisjsewell merged commit f41d88c into master May 13, 2026
12 checks passed
@chrisjsewell chrisjsewell deleted the fix-field-list branch May 13, 2026 08:57
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.

Nested field list parsing issue

1 participant