mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 22:40:13 +01:00
Update MD006/ul-start-left to report/fix for all top-level items in lists that start indented.
This commit is contained in:
parent
e717608cac
commit
3981bc7897
4 changed files with 42 additions and 15 deletions
26
lib/md006.js
26
lib/md006.js
|
|
@ -14,18 +14,20 @@ module.exports = {
|
|||
"function": function MD006(params, onError) {
|
||||
flattenedLists().forEach((list) => {
|
||||
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
|
||||
});
|
||||
list.items.forEach((item) => {
|
||||
const { lineNumber, line } = item;
|
||||
addErrorDetailIf(
|
||||
onError,
|
||||
lineNumber,
|
||||
0,
|
||||
list.indent,
|
||||
null,
|
||||
null,
|
||||
rangeFromRegExp(line, listItemMarkerRe),
|
||||
{
|
||||
"deleteCount": line.length - line.trimLeft().length
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue