Update MD051/link-fragments to not provide error context for multi-line scenarios.

This commit is contained in:
David Anson 2023-08-04 21:23:43 -07:00
parent ef1bd286a9
commit 1eb40d3c4c
4 changed files with 12 additions and 8 deletions

View file

@ -94,11 +94,14 @@ module.exports = {
definition.text.startsWith("#") &&
!fragments.has(definition.text)
) {
// eslint-disable-next-line no-undef-init
let context = undefined;
// eslint-disable-next-line no-undef-init
let range = undefined;
// eslint-disable-next-line no-undef-init
let fixInfo = undefined;
if (link.startLine === link.endLine) {
context = link.text;
range = [ link.startColumn, link.endColumn - link.startColumn ];
fixInfo = {
"editColumn": definition.startColumn,
@ -117,7 +120,7 @@ module.exports = {
mixedCaseKey,
definition.text,
undefined,
link.text,
context,
range,
fixInfo
);
@ -126,7 +129,7 @@ module.exports = {
onError,
link.startLine,
undefined,
link.text,
context,
range
);
}