Skip to content

Conversation

lumirlumir
Copy link
Member

@lumirlumir lumirlumir commented Jun 3, 2025

Prerequisites checklist

What is the purpose of this pull request?

Which language are you using?

CommonMark and GFM.

What did you do?

I've used *foo*, **foo**, ~~foo~~, ~~**foo**~~, ~~***foo***~~, and similar formats for the definition. Based on this, I expected patterns like the ones below to be reported as missing label references, but some were not detected.

image

What did you expect to happen?

According to the AST, patterns like *foo*, **foo**, ~~foo~~, ~~**foo**~~, and ~~***foo***~~ can be recognized as valid label references:

image

So, I expected the following patterns to be reported by this rule:

<!-- eslint markdown/no-missing-label-refs: "error" -->
- [*foo*]

- [**foo**]

- [~~foo~~]

- [~~**foo**~~]

- [~~***foo***~~]

Link to minimal reproducible Example

<!-- eslint markdown/no-missing-label-refs: "error" -->

<!-- OK -->
- [foo]

<!-- Not OK -->
- [*foo*]

- [**foo**]

- [~~foo~~]

- [~~**foo**~~]

- [~~***foo***~~]

What changes did you make? (Give an overview)

The current implementation only checks the Text node when detecting missing label reference syntax.

However, this causes an issue when Strong, Emphasis, or Delete markers (represented by *, _, or ~) are used in the syntax.

With these markers, a label like [**foo**] will have its Text node split into [, foo, and ] as shown in the AST below, making it impossible to detect the missing label reference pattern.

image

Related Issues

N/A

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

@eslint-github-bot eslint-github-bot bot added the bug label Jun 3, 2025
@lumirlumir lumirlumir added this to Triage Jun 3, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Jun 3, 2025
@nzakas nzakas moved this from Needs Triage to Implementing in Triage Jun 19, 2025
@lumirlumir
Copy link
Member Author

I’ll take a look at this PR within the next two weeks, as I currently have some higher-priority PRs in progress.

Copy link
Contributor

Hi everyone, it looks like we lost track of this pull request. Please review and see what the next steps are. This pull request will auto-close in 7 days without an update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Implementing
Development

Successfully merging this pull request may close these issues.

1 participant