Expand MD061 footnote content coverage tests#1
Conversation
There was a problem hiding this comment.
This PR is being reviewed by Cursor Bugbot
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| if indent >= base_indent + MKDOCS_CONTENT_INDENT { | ||
| if mkdocs_footnotes::is_footnote_definition(line) { | ||
| current_footnote = Some((mkdocs_footnotes::get_footnote_indent(line).unwrap_or(0), i)); | ||
| } |
There was a problem hiding this comment.
Bug: Footnote Indentation: Rule Misinterprets Definition Scope
MD061 incorrectly treats indented text containing [^id]: patterns as nested footnote definitions. When continuation text like Text mentioning [^2]: something appears within a footnote, the rule updates current_footnote state, causing subsequent properly-indented lines to be incorrectly flagged as violations. The is_footnote_definition regex matches [^id]: anywhere in indented lines, but only column-zero footnote definitions should reset the tracking state.
Summary
Testing
Codex Task
Note
Adds MD061 to enforce 4-space indentation for footnote continuations (with autofix) and updates MD046 to ignore footnote bodies, plus docs and comprehensive tests.
MD061(new): Enforces 4-space indentation for multi-line footnote continuations; provides automatic fixes (src/rules/md061_footnote_indentation.rs).MD046: Skips legitimate footnote continuation lines when detecting indented code; uses new footnote context (src/rules/md046_code_block_style.rs).mkdocs_footnotes::compute_footnote_context()to map footnote body lines (src/utils/mkdocs_footnotes.rs).MD061in rules module and factory (src/rules/mod.rs).CHANGELOG.md).docs/md061.md; updatedocs/md046.mdspecial cases; includeMD061indocs/RULES.mdand rule count 55.MD061covering blockquotes, code, lists, tables, thematic breaks, HTML (tests/rules/md061_test.rs).MD046regression test to ensure footnotes aren’t mis-flagged (tests/rules/md046_test.rs).Written by Cursor Bugbot for commit 6f99b24. This will update automatically on new commits. Configure here.