vscode-markdown-languageservice
vscode-markdown-languageservice copied to clipboard
Support comment-based skipping of specific link validation (similar to `<!-- markdownlint-disable -->`)
Description
When writing documentation, it is sometimes necessary to use anchors or special links that automated link validation incorrectly flags as broken.
Currently, there is no way to skip validation for a single link or a small section of content.
It would be helpful to support a comment-based mechanism, similar to markdownlint, that allows temporarily disabling link validation.
Proposed Solution
Introduce the following comment directives:
<!-- link-validate-disable -->
[A](#A) <!-- link-validate-disable-line -->
<!-- link-validate-enable-->
<a id='A'></a>
A
-
<!-- link-validate-disable -->: disable link validation starting from this point -
<!-- link-validate-disable-line -->: disable link validation only for the current line -
<!-- link-validate-enable -->: re-enable link validation
Benefits
- Prevents false positives and improves the documentation authoring experience
- Consistent with
markdownlintusage, reducing the learning curve - Provides fine-grained control, useful in collaborative documentation workflows
Additional Context
markdownlint already supports a similar mechanism:
<!-- markdownlint-disable -->
<!-- markdownlint-enable -->
Bringing this capability to VSCode would make link validation more flexible and practical, especially in CI/CD pipelines where false positives can block builds.