vscode-markdown-languageservice icon indicating copy to clipboard operation
vscode-markdown-languageservice copied to clipboard

Common DocFx [!NOTE] notation being flagged with verify links

Open MicroTuld opened this issue 2 years ago • 3 comments

With DocFx, a common syntax is:

> [!NOTE]
> This is a special note box.

but verification is flagging this with "No link definition found" (link.no-such-reference). This seems to be because () is expected.

I would like to continue using link verification, but the only override available seems to be for what is inside the (), not the [].

This issue seems to be similar to #152

MicroTuld avatar Dec 12 '23 19:12 MicroTuld

Agreed - I suggest updating the issue title to cover all Markdown alerts, something like

Markdown alerts cause false positives from link detection feature (link.no-such-reference).

  • Other false-positive link detection issues:
    • #155
    • https://github.com/microsoft/vscode/issues/150672
  • Markdown alerts:

That should cover at least [!NOTE], [!TIP], [!IMPORTANT], [!CAUTION], and [!WARNING] but perhaps this could be safely generalized for any "links" that start with a bang !.

lucaspar avatar Mar 01 '24 15:03 lucaspar

It seems this is the block that needs to change - if any devs want to take on this task:

https://github.com/microsoft/vscode-markdown-languageservice/blob/eb65157b610fca5e04ab44103ebea25a707add47/src/languageFeatures/documentLinks.ts#L291-L314

lucaspar avatar Mar 01 '24 16:03 lucaspar

I'm good with adding a special case for [! refs. Spec wise you can write:

[!NOTE]

[!NOTE]: http://example.com

but it's likely not common

mjbvz avatar Mar 28 '24 20:03 mjbvz