Markdown: validation: link: false positives in math code

Open
#323,229 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
56/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
typescript
Domain
tooling

Research direction

Start by reproducing the warning with markdown.validate.enabled in a Markdown document containing the shown $$ math block, then trace the Markdown validation path responsible for link.no-such-reference. Done means bracketed math expressions no longer produce false link warnings, while ordinary link validation continues to work.

Written by the indexing model from the issue text.

Description

Not links are detected as links in math, for example:

$$
c = 3 \left[ a - b \right]
$$

produces a warning: No link definition found: 'a - b \right' (link.no-such-reference). Obviously there is no link in the expression.
Often square brackets are used to simplify the perception of a formula with a lot of parentheses, it's not me being weird.

Since VSCode does render math, I think the issue is relevant to VSCode.

I guess links shouldn't be validated in math code at all, or only inside \text{...}.

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.123.0
  • Commit: 6a44c352bd24569c417e530095901b649960f9f8

Steps to Reproduce:

  1. Have "markdown.validate.enabled" = true in your settings
  2. Open a markdown document and paste the code (or any other containing brackets [ and ] on the same line):
    $$
    c = 3 \left[ a - b \right]
    $$
    
  3. See the error is present.
Dominant language
TypeScript
Stars
193k
Forks
42.9k
PR merge metrics
PR metrics pending

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/vscode

All issues in microsoft/vscode

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.