Update MD011/MD034 to report fixInfo for violations.

This commit is contained in:
David Anson 2019-09-04 22:18:23 -07:00
parent 5e73aa1d9d
commit 620853f200
3 changed files with 41 additions and 8 deletions

View file

@ -26,7 +26,20 @@ module.exports = {
line.indexOf(content) + match.index + 1,
bareUrl.length
];
addErrorContext(onError, lineNumber, bareUrl, null, null, range);
const fixInfo = range ? {
"editColumn": range[0],
"deleteCount": range[1],
"insertText": `<${bareUrl}>`
} : null;
addErrorContext(
onError,
lineNumber,
bareUrl,
null,
null,
range,
fixInfo
);
}
});
});