[GH-ISSUE #106] MD005 or MD007, Does not work? #1938

Closed
opened 2026-03-07 20:02:56 +03:00 by kerem · 6 comments
Owner

Originally created by @ryunix on GitHub (Feb 23, 2018).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/106

Created the test.md.

# header

- item 1
    - item 1.1
- item 2
    - item 2.1
$ markdownlint test.md
test.md: 4: MD007/ul-indent Unordered list indentation [Expected: 2; Actual: 4]

Only error on line 4 will occur.
This is same result as mdl.

$ mdl test.md
test.md:4: MD007 Unordered list indentation

Fixed the test.md.

# header

- item 1
  - item 1.1
- item 2
    - item 2.1
$ markdownlint test.md
$

Oops, no error. 🙀
mdl will result in an error.

$ mdl test.md
test.md:6: MD005 Inconsistent indentation for list items at the same level

I want an MD005 error just like mdl.
However, I think that MD007 error is appropriate. 🤔

Originally created by @ryunix on GitHub (Feb 23, 2018). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/106 Created the `test.md`. ```markdown # header - item 1 - item 1.1 - item 2 - item 2.1 ``` ```bash $ markdownlint test.md test.md: 4: MD007/ul-indent Unordered list indentation [Expected: 2; Actual: 4] ``` Only error on line 4 will occur. This is same result as [mdl](https://github.com/markdownlint/markdownlint). ```bash $ mdl test.md test.md:4: MD007 Unordered list indentation ``` --- Fixed the `test.md`. ```markdown # header - item 1 - item 1.1 - item 2 - item 2.1 ``` ```bash $ markdownlint test.md $ ``` Oops, no error. 🙀 [mdl](https://github.com/markdownlint/markdownlint) will result in an error. ```bash $ mdl test.md test.md:6: MD005 Inconsistent indentation for list items at the same level ``` --- I want an MD005 error just like [mdl](https://github.com/markdownlint/markdownlint). However, I think that MD007 error is appropriate. 🤔
kerem 2026-03-07 20:02:56 +03:00
Author
Owner

@DavidAnson commented on GitHub (Feb 23, 2018):

Sorry, I’ll have a look once I finish the current feature.

<!-- gh-comment-id:368126383 --> @DavidAnson commented on GitHub (Feb 23, 2018): Sorry, I’ll have a look once I finish the current feature.
Author
Owner

@ryunix commented on GitHub (Feb 23, 2018):

That’s all right. Thank you. 😸

<!-- gh-comment-id:368133161 --> @ryunix commented on GitHub (Feb 23, 2018): That’s all right. Thank you. 😸
Author
Owner

@ryunix commented on GitHub (Mar 11, 2018):

hi, Thank you for fixing. 😸

However, I think problem is not solved. 🤔
I tried version v0.8.0 and test/list-indentation.md file.

 1|# list-indentation
 2|
 3|Text
 4|
 5|- Item
 6|    - Item {MD007}
 7|- Item
 8|    - Item {MD007}
 9|
10|Text
11|
12|- Item
13|  - Item
14|- Item
15|    - Item {MD007}
16|
17|Text
18|
19|- Item
20|    - Item {MD007}
21|- Item
22|  - Item
$ markdownlint list-indentation.md
list-indentation.md: 6: MD007/ul-indent Unordered list indentation [Expected: 2; Actual: 4]
list-indentation.md: 20: MD007/ul-indent Unordered list indentation [Expected: 2; Actual: 4]

Line 15 is not marked as an error.
Can you check it again?

<!-- gh-comment-id:372106475 --> @ryunix commented on GitHub (Mar 11, 2018): hi, Thank you for fixing. 😸 However, I think problem is not solved. 🤔 I tried version `v0.8.0` and `test/list-indentation.md` file. ```markdown 1|# list-indentation 2| 3|Text 4| 5|- Item 6| - Item {MD007} 7|- Item 8| - Item {MD007} 9| 10|Text 11| 12|- Item 13| - Item 14|- Item 15| - Item {MD007} 16| 17|Text 18| 19|- Item 20| - Item {MD007} 21|- Item 22| - Item ``` ```bash $ markdownlint list-indentation.md list-indentation.md: 6: MD007/ul-indent Unordered list indentation [Expected: 2; Actual: 4] list-indentation.md: 20: MD007/ul-indent Unordered list indentation [Expected: 2; Actual: 4] ``` Line 15 is not marked as an error. Can you check it again?
Author
Owner

@DavidAnson commented on GitHub (Mar 11, 2018):

I have not updated the CLI to use the latest version yet, are you sure your test is using v0.8.0? (You would have needed to update the package within the global install.)

The test file above is part of every test run for v0.8.0: https://travis-ci.org/DavidAnson/markdownlint

<!-- gh-comment-id:372133479 --> @DavidAnson commented on GitHub (Mar 11, 2018): I have not updated the CLI to use the latest version yet, are you sure your test is using v0.8.0? (You would have needed to update the package within the global install.) The test file above is part of every test run for v0.8.0: https://travis-ci.org/DavidAnson/markdownlint
Author
Owner

@DavidAnson commented on GitHub (Mar 12, 2018):

I think you'll find this works as you want - see below. Note that npm automatically nests the old version of markdownlint for markdownlint-cli, so it's necessary to remove that for the new one to be used.

C:\T\T>type list-indentation.md
# list-indentation

Text

- Item
    - Item {MD007}
- Item
    - Item {MD007}

Text

- Item
  - Item
- Item
    - Item {MD007}

Text

- Item
    - Item {MD007}
- Item
  - Item

C:\T\T>npm i markdownlint-cli

+ markdownlint-cli@0.7.1
added 29 packages in 2.219s

C:\T\T>node_modules\.bin\markdownlint list-indentation.md
list-indentation.md: 6: MD007/ul-indent Unordered list indentation [Expected: 2; Actual: 4]
list-indentation.md: 20: MD007/ul-indent Unordered list indentation [Expected: 2; Actual: 4]

C:\T\T>npm list markdownlint
C:\T\T
`-- markdownlint-cli@0.7.1
  `-- markdownlint@0.7.0

C:\T\T>npm i markdownlint@0.8.0

+ markdownlint@0.8.0
added 2 packages and updated 1 package in 1.282s

C:\T\T>node_modules\.bin\markdownlint list-indentation.md
list-indentation.md: 6: MD007/ul-indent Unordered list indentation [Expected: 2; Actual: 4]
list-indentation.md: 20: MD007/ul-indent Unordered list indentation [Expected: 2; Actual: 4]

C:\T\T>rd /s node_modules\markdownlint-cli\node_modules\markdownlint
node_modules\markdownlint-cli\node_modules\markdownlint, Are you sure (Y/N)? y

C:\T\T>node_modules\.bin\markdownlint list-indentation.md
list-indentation.md: 6: MD007/ul-indent Unordered list indentation [Expected: 2; Actual: 4]
list-indentation.md: 8: MD007/ul-indent Unordered list indentation [Expected: 2; Actual: 4]
list-indentation.md: 15: MD007/ul-indent Unordered list indentation [Expected: 2; Actual: 4]
list-indentation.md: 20: MD007/ul-indent Unordered list indentation [Expected: 2; Actual: 4]

C:\T\T>
<!-- gh-comment-id:372162398 --> @DavidAnson commented on GitHub (Mar 12, 2018): I think you'll find this works as you want - see below. Note that `npm` automatically nests the old version of `markdownlint` for `markdownlint-cli`, so it's necessary to remove that for the new one to be used. ``` C:\T\T>type list-indentation.md # list-indentation Text - Item - Item {MD007} - Item - Item {MD007} Text - Item - Item - Item - Item {MD007} Text - Item - Item {MD007} - Item - Item C:\T\T>npm i markdownlint-cli + markdownlint-cli@0.7.1 added 29 packages in 2.219s C:\T\T>node_modules\.bin\markdownlint list-indentation.md list-indentation.md: 6: MD007/ul-indent Unordered list indentation [Expected: 2; Actual: 4] list-indentation.md: 20: MD007/ul-indent Unordered list indentation [Expected: 2; Actual: 4] C:\T\T>npm list markdownlint C:\T\T `-- markdownlint-cli@0.7.1 `-- markdownlint@0.7.0 C:\T\T>npm i markdownlint@0.8.0 + markdownlint@0.8.0 added 2 packages and updated 1 package in 1.282s C:\T\T>node_modules\.bin\markdownlint list-indentation.md list-indentation.md: 6: MD007/ul-indent Unordered list indentation [Expected: 2; Actual: 4] list-indentation.md: 20: MD007/ul-indent Unordered list indentation [Expected: 2; Actual: 4] C:\T\T>rd /s node_modules\markdownlint-cli\node_modules\markdownlint node_modules\markdownlint-cli\node_modules\markdownlint, Are you sure (Y/N)? y C:\T\T>node_modules\.bin\markdownlint list-indentation.md list-indentation.md: 6: MD007/ul-indent Unordered list indentation [Expected: 2; Actual: 4] list-indentation.md: 8: MD007/ul-indent Unordered list indentation [Expected: 2; Actual: 4] list-indentation.md: 15: MD007/ul-indent Unordered list indentation [Expected: 2; Actual: 4] list-indentation.md: 20: MD007/ul-indent Unordered list indentation [Expected: 2; Actual: 4] C:\T\T> ```
Author
Owner

@ryunix commented on GitHub (Mar 12, 2018):

Oops. 🙀

I'm using markdownlint-cli.
I thought that markdownlint-cli was using latest version markdownlint, but actually it is an old version markdownlint.

I confirmed that using latest version solves the problem.
Thank you very much. 😸

Sorry to take up your time. 🙇

<!-- gh-comment-id:372185602 --> @ryunix commented on GitHub (Mar 12, 2018): Oops. 🙀 I'm using `markdownlint-cli`. I thought that `markdownlint-cli` was using latest version `markdownlint`, but actually it is an old version `markdownlint`. I confirmed that using latest version solves the problem. Thank you very much. 😸 Sorry to take up your time. 🙇
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/markdownlint#1938
No description provided.