Skip to content

fix: mask footnote references in no-reversed-media-syntax - #743

Merged
DMartens merged 1 commit into
mainfrom
fix/mask-footnote-references=in-no-reversed-media-syntax
Sep 22, 2026
Merged

DMartens merged 1 commit into
mainfrom
fix/mask-footnote-references=in-no-reversed-media-syntax

Conversation

@lumirlumir

@lumirlumir lumirlumir commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

Prerequisites checklist

AI acknowledgment

  • I did not use AI to generate this PR.
  • (If the above is not checked) I have reviewed the AI-generated content before submitting.

What is the purpose of this pull request?

Environment

ESLint version: 10.9.1
@eslint/markdown version: 8.0.3
Node version: 24.18.0
npm version: 11.16.0
Operating System: Windows

Which language are you using?

gfm

What did you do?

rules: {
  "markdown/no-reversed-media-syntax": "error",
}
(foo)[^bar]

[^bar]: footnote

What did you expect to happen?

No error. [^bar] is a GFM footnote reference, not a reversed link.

Code Explorer

What actually happened?

The rule reports (foo)[^bar] as reversed syntax and the autofix changes it to:

[foo](^bar)

Link to Minimal Reproducible Example

The reproduction is included above.

What changes did you make? (Give an overview)

Fixed a bug metioned above and added a test case to prevent regression.

Related Issues

N/A

Is there anything you'd like reviewers to focus on?

N/A

Summary by CodeRabbit

  • Bug Fixes

    • Prevented reversed media syntax checks from incorrectly flagging content inside footnote references.
    • Footnote references are now handled consistently across headings, paragraphs, and table cells.
  • Tests

    • Added coverage confirming valid GFM footnote references are accepted without warnings.

@coderabbitai

coderabbitai Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. πŸŽ‰

ℹ️ Recent review info
βš™οΈ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 51f584cb-cb4e-4938-ab62-951b0f84473b

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 4cc3873 and 77ba904.

πŸ“’ Files selected for processing (2)
  • src/rules/no-reversed-media-syntax.js
  • tests/rules/no-reversed-media-syntax.test.js

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


πŸ“ Walkthrough

Walkthrough

The rule now recognizes FootnoteReference nodes and masks their source ranges before reversed media syntax detection. A GFM test confirms that (foo)[^bar] is valid when paired with a footnote definition.

Changes

Footnote Reference Support

Layer / File(s) Summary
Mask footnote references in syntax detection
src/rules/no-reversed-media-syntax.js, tests/rules/no-reversed-media-syntax.test.js
The rule imports and masks FootnoteReference nodes. The test suite adds a valid GFM footnote reference case.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

πŸš₯ Pre-merge checks | βœ… 5
βœ… Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage βœ… Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Linked Issues check βœ… Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check βœ… Passed Check skipped because no linked issues were found for this pull request.
Description Check βœ… Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check βœ… Passed The title clearly and concisely describes the main change: masking footnote references in the no-reversed-media-syntax rule.
✨ Finishing Touches
πŸ“ Generate docstrings
  • Commit to this branch
  • Create a new PR
πŸ§ͺ Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❀️ Share

Comment @coderabbitai help to get the list of available commands.

@eslintbot eslintbot added this to Triage Sep 18, 2026
@github-project-automation github-project-automation Bot moved this to Needs Triage in Triage Sep 18, 2026
@lumirlumir lumirlumir moved this from Needs Triage to Implementing in Triage Sep 18, 2026
@lumirlumir lumirlumir moved this from Implementing to Needs Triage in Triage Sep 19, 2026
@lumirlumir
lumirlumir marked this pull request as ready for review September 19, 2026 13:38

@Pixel998 Pixel998 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, thanks! Leaving open for others to review.

@Pixel998 Pixel998 moved this from Needs Triage to Merge Candidates in Triage Sep 20, 2026

@DMartens DMartens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes LGTM, thanks.

@DMartens
DMartens merged commit 03bcec5 into main Sep 22, 2026
41 checks passed
@DMartens
DMartens deleted the fix/mask-footnote-references=in-no-reversed-media-syntax branch September 22, 2026 22:25
@github-project-automation github-project-automation Bot moved this from Merge Candidates to Complete in Triage Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

3 participants