Add infrastructure for rules to include fix information when logging violations, update MD047 (refs #80).

This commit is contained in:
David Anson 2019-08-16 19:56:52 -07:00
parent 6e086114b1
commit cdd87e647f
6 changed files with 248 additions and 19 deletions

View file

@ -381,7 +381,8 @@ function lintContent(
"lineNumber": errorInfo.lineNumber + frontMatterLines.length,
"detail": errorInfo.detail || null,
"context": errorInfo.context || null,
"range": errorInfo.range || null
"range": errorInfo.range || null,
"fixInfo": errorInfo.fixInfo || null
});
}
// Call (possibly external) rule function
@ -423,6 +424,9 @@ function lintContent(
errorObject.errorDetail = error.detail;
errorObject.errorContext = error.context;
errorObject.errorRange = error.range;
if (resultVersion === 3) {
errorObject.fixInfo = error.fixInfo;
}
return errorObject;
});
if (filteredErrors.length) {