mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 22:40:13 +01:00
Update MD009/MD010/MD012/MD028 to report fixInfo for violations.
This commit is contained in:
parent
679c83e23b
commit
2cd27c58f2
8 changed files with 165 additions and 31 deletions
19
lib/md028.js
19
lib/md028.js
|
|
@ -10,12 +10,29 @@ module.exports = {
|
|||
"tags": [ "blockquote", "whitespace" ],
|
||||
"function": function MD028(params, onError) {
|
||||
let prevToken = {};
|
||||
let prevLineNumber = null;
|
||||
params.tokens.forEach(function forToken(token) {
|
||||
if ((token.type === "blockquote_open") &&
|
||||
(prevToken.type === "blockquote_close")) {
|
||||
addError(onError, token.lineNumber - 1);
|
||||
for (
|
||||
let lineNumber = prevLineNumber;
|
||||
lineNumber < token.lineNumber;
|
||||
lineNumber++) {
|
||||
addError(
|
||||
onError,
|
||||
lineNumber,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
{
|
||||
"deleteCount": -1
|
||||
});
|
||||
}
|
||||
}
|
||||
prevToken = token;
|
||||
if (token.type === "blockquote_open") {
|
||||
prevLineNumber = token.map[1] + 1;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue