Coder Social home page Coder Social logo

Comments (3)

lucaspar avatar lucaspar commented on May 27, 2024 1

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).

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 !.

from vscode-markdown-languageservice.

lucaspar avatar lucaspar commented on May 27, 2024

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

/**
* Matches `[text][ref]` or `[shorthand]` or `[shorthand][]`
*/
const referenceLinkPattern = new RegExp(
r`(^|[^\]\\])` + // Must not start with another bracket (workaround for lack of support for negative look behinds)
r`(?:` +
/**/r`(?:` +
/****/r`(` + // Start link prefix
/******/r`!?` + // Optional image ref
/******/r`\[((?:` +// Link text
/********/r`\\\]|` + // escaped bracket, or...
/********/r`[^\[\]]|` + //non bracket char, or...
/********/r`\[[^\[\]]*\]` + // matched bracket pair
/******/`+)*)\]` + // end link text
/******/r`\[\s*?` + // Start of link def
/****/r`)` + // end link prefix
/****/r`(` +
/******/r`[^\]]*?)\]` + //link def
/******/r`|` +
/******/r`\[\s*?([^\\\]]*?)\s*\])(?![\(])` +
r`)`,
'gm');

from vscode-markdown-languageservice.

mjbvz avatar mjbvz commented on May 27, 2024

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

from vscode-markdown-languageservice.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.