Skip to content

Expand MD061 footnote content coverage tests#1

Open
RobertoGongora wants to merge 1 commit into
mainfrom
codex/investigate-md046-issue-with-footnotes
Open

Expand MD061 footnote content coverage tests#1
RobertoGongora wants to merge 1 commit into
mainfrom
codex/investigate-md046-issue-with-footnotes

Conversation

@RobertoGongora

@RobertoGongora RobertoGongora commented Nov 10, 2025

Copy link
Copy Markdown
Owner

Summary

  • add dedicated MD061 regression tests covering blockquotes, code blocks, lists, tables, thematic breaks, and HTML inside footnotes
  • document the new MD061 rule and MD046 footnote handling in the changelog and rule docs

Testing

  • cargo fmt
  • cargo test --test lib md061

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.

  • Rules:
    • 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).
  • Utils:
    • Add mkdocs_footnotes::compute_footnote_context() to map footnote body lines (src/utils/mkdocs_footnotes.rs).
  • Registration:
    • Register MD061 in rules module and factory (src/rules/mod.rs).
  • Docs:
    • Changelog entry for MD061 and MD046 fix (CHANGELOG.md).
    • Add docs/md061.md; update docs/md046.md special cases; include MD061 in docs/RULES.md and rule count 55.
  • Tests:
    • New suites for MD061 covering blockquotes, code, lists, tables, thematic breaks, HTML (tests/rules/md061_test.rs).
    • MD046 regression 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.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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));
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant