Skip to content

Conversation

@lumirlumir
Copy link
Member

@lumirlumir lumirlumir commented Sep 13, 2025

Prerequisites checklist

What is the purpose of this pull request?

Which language are you using?

CommonMark and GFM.

What did you do?

I expected no-reversed-media-syntax not to report occurrences inside Image, ImageReference, or LinkReference, but it does.

Image, ImageReference, and LinkReference are nodes where a Link node using the []() syntax cannot appear, so these are false positives.

image

What did you expect to happen?

I expect no false positives to occur in Image, ImageReference, or LinkReference nodes.

Link to minimal reproducible Example

The following Markdown code may help identify the problem:

<!-- eslint markdown/no-reversed-media-syntax: "error" -->

<!-- Image -->
![()[]](hi)
![(hi)[something]](hi)
![()[]](https://example.com)

<!-- ImageReference -->

![()[]][ref]
![(hi)[something]]

<!-- LinkReference -->

[()[]][ref]
[(hi)[something]][ref]

<!-- ---------------------- -->

[ref]: https://example.com

What changes did you make? (Give an overview)

In this PR, I've fixed false positives in no-reversed-media-syntax rule.

Image, ImageReference, and LinkReference are nodes where a Link node using the []() syntax cannot appear, so these are false positives.

Related Issues

N/A

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

N/A

@eslintbot eslintbot added this to Triage Sep 13, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Sep 13, 2025
@github-actions

This comment was marked as outdated.

@aladdin-add aladdin-add moved this from Needs Triage to Implementing in Triage Oct 10, 2025
},
],
},
{
Copy link
Member Author

Choose a reason for hiding this comment

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

This test case isn't related to this change, but the test for the Image node within a FootnoteReference node was missing, so I've added one.

@lumirlumir lumirlumir marked this pull request as ready for review November 3, 2025 14:12
@lumirlumir lumirlumir moved this from Implementing to Needs Triage in Triage Nov 3, 2025
Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@mdjermanovic mdjermanovic merged commit bee20dd into main Nov 3, 2025
24 checks passed
@mdjermanovic mdjermanovic deleted the fix-false-positives-in-no-reversed-media-syntax branch November 3, 2025 14:56
@github-project-automation github-project-automation bot moved this from Needs Triage to Complete in Triage Nov 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

3 participants