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
Copy link
Copy Markdown

codecov Bot commented May 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.68%. Comparing base (d11bdaf) to head (71d108a).
⚠️ Report is 12 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #139      +/-   ##
==========================================
- Coverage   92.80%   92.68%   -0.12%     
==========================================
  Files          31       38       +7     
  Lines        1835     2257     +422     
==========================================
+ Hits         1703     2092     +389     
- Misses        132      165      +33     
Flag Coverage Δ
pytests 92.68% <100.00%> (-0.12%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@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