gicentre / litvis

Literate Visualization: Theory, software and examples
https://www.gicentre.net/litvis
BSD 3-Clause "New" or "Revised" License
376 stars 26 forks source link

Markdown linter uses 2 space indentations for list items but default is 1 #48

Closed jwoLondon closed 4 years ago

jwoLondon commented 4 years ago

Markdown linting rule MD030, which determines the number of spaces after a list marker, suggests 1 space by default. Validation of markdown on our GitHub setup suggests 2 and so generates listing warnings with a default formatted document.

MD030/list-marker-space Spaces after list markers [Expected: 2; Actual: 1]

Is there any reason why we shouldn't use the default of 1?

kachkaev commented 4 years ago

Hi Jo!

We use one space for unordered lists, so that blocks in list items were padded by two spaces.

- Hello

  Two leading spaces here 👍

code listing


- World

If we do the same for the ordered lists, these elements (including code listings) will be padded by three spaces.

1. Hello

   Three leading spaces here 👎

code listing


1. World

Adding one extra space makes this offset even, which simplifies actions like select + tab / select + shift tab in the editor.

1.  Hello

    Four leading spaces here 👍
code listing
```
  1. World

Because we don't know in advance which lists will have blocks and which ones will remain simple, the same rule applies everywhere. Happy to update our setup if there is possibility for some other convenient configuration.

jwoLondon commented 4 years ago

Ah, OK, that makes sense. I will update my local markdown linting config to conform with this.