labelReferenceValidity
Reports invalid label references with whitespace.
✅ This rule is included in the md logical preset.
CommonMark’s shorthand label reference syntax ([label][]) does not allow whitespace between the brackets.
When whitespace is present, CommonMark-compliant renderers will not treat this as a link reference.
While GitHub may render this correctly, relying on this behavior could result in errors when using other Markdown processors.
Examples
Section titled “Examples”[eslint][ ][eslint][ ][link][ ][eslint][][eslint][eslint][link][ref]
[ref]: https://example.comWhen Not To Use It
Section titled “When Not To Use It”If you publish your Markdown exclusively on GitHub and don’t need compatibility with other CommonMark-compliant renderers, you can safely disable this rule.
Further Reading
Section titled “Further Reading”Equivalents in Other Linters
Section titled “Equivalents in Other Linters”- ESLint:
markdown/no-invalid-label-refs
Made with ❤️🔥 in Boston by
Josh Goldberg and contributors.