mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 06:20:12 +01:00
Allow for first level indentation of lists in MD007/ul-indent (fixes #242).
This commit is contained in:
parent
5634b317d6
commit
9aeddedb7d
7 changed files with 81 additions and 3 deletions
|
|
@ -11,12 +11,14 @@ module.exports = {
|
|||
"description": "Unordered list indentation",
|
||||
"tags": [ "bullet", "ul", "indentation" ],
|
||||
"function": function MD007(params, onError) {
|
||||
const optionsIndent = params.config.indent || 2;
|
||||
const indent = params.config.indent || 2;
|
||||
const startIndented = !!params.config.start_indented;
|
||||
flattenedLists().forEach((list) => {
|
||||
if (list.unordered && list.parentsUnordered) {
|
||||
list.items.forEach((item) => {
|
||||
const { lineNumber, line } = item;
|
||||
const expectedIndent = list.nesting * optionsIndent;
|
||||
const expectedNesting = list.nesting + (startIndented ? 1 : 0);
|
||||
const expectedIndent = expectedNesting * indent;
|
||||
const actualIndent = indentFor(item);
|
||||
let range = null;
|
||||
let editColumn = 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue