Disallow invalid label references.
CommonMark allows you to specify a label as a placeholder for a URL in both links and images using square brackets, such as:
[ESLint][eslint]
[eslint][]
[eslint]
[eslint]: https://eslint.orgThe shorthand form, [label][] does not allow any white space between the brackets, and when found, doesn't treat this as a link reference.
Confusingly, GitHub still treats this as a label reference and will render it as if there is no white space between the brackets. Relying on this behavior could result in errors when using CommonMark-compliant renderers.
This rule warns when it finds text that looks like it's a shorthand label reference and there's white space between the brackets.
Examples of incorrect code for this rule:
<!-- eslint markdown/no-invalid-label-refs: "error" -->
[eslint][ ]
[eslint][
]If you publish your Markdown exclusively on GitHub, then you can safely disable this rule.