Update MD006/MD023 to report fixInfo for violations, process input to fixErrors.

This commit is contained in:
David Anson 2019-09-02 15:35:43 -07:00
parent 84e972c72c
commit 5e73aa1d9d
5 changed files with 94 additions and 25 deletions

View file

@ -13,10 +13,19 @@ module.exports = {
"tags": [ "bullet", "ul", "indentation" ],
"function": function MD006(params, onError) {
flattenedLists().forEach((list) => {
if (list.unordered && !list.nesting) {
addErrorDetailIf(onError, list.open.lineNumber,
0, list.indent, null, null,
rangeFromRegExp(list.open.line, listItemMarkerRe));
if (list.unordered && !list.nesting && (list.indent !== 0)) {
const { lineNumber, line } = list.open;
addErrorDetailIf(
onError,
lineNumber,
0,
list.indent,
null,
null,
rangeFromRegExp(line, listItemMarkerRe),
{
"deleteCount": line.length - line.trimLeft().length
});
}
});
}