Skip to content
This repository has been archived by the owner on May 27, 2021. It is now read-only.

Indentation Issue - MD007/ul-indent #60

Open
jmcmaster05 opened this issue Sep 19, 2018 · 2 comments · May be fixed by #92
Open

Indentation Issue - MD007/ul-indent #60

jmcmaster05 opened this issue Sep 19, 2018 · 2 comments · May be fixed by #92

Comments

@jmcmaster05
Copy link

jmcmaster05 commented Sep 19, 2018

Issue

Notice from VS Code - Markdown Lint (davidanson.vscode-markdownlint)
MD007/ul-indent: Unordered list indentation [Expected: 2; Actual: 4]
https://github.com/DavidAnson/markdownlint/blob/v0.11.0/doc/Rules.md#md007

Example

<!-- TOC -->

- [Generate SSH Key for SFTP Use](#generate-ssh-key-for-sftp-use)
    - [Table of Contents](#table-of-contents)
    - [References](#references)

Currently TOC uses 4 spaces for each indentation for the Unordered TOC list, instead of the standard 2 spaces.

Code

https://github.com/AlanWalk/markdown-toc/blob/1fc815ec26d063b38502932641a80497fbf71f24/src/extension.ts#L268

editor.tabSize is defaulted to 4.

Workaround

Create .markdownlint.json in project root per project. 😞

{
    "MD007": { "indent": 4 }
}

Please let me know if I've overlooked a setting or if you are aware of a better solution.
I've researched yzhang-gh/vscode-markdown#155

@kenorb
Copy link

kenorb commented Aug 5, 2019

The extension is using exactly what you've in the settings (Editor: Tab Size). If you set it to 2, then the plugin will regenerate TOC with indention of 2 spaces. So this could be the issue with markdownlint.

Related: DavidAnson/markdownlint/issues/210

@DavidAnson
Copy link

I looked into this for the related issue in the vscode-markdownlint project. Short version is that I do not think this is a good use of editor.tabSize. Long version: DavidAnson/vscode-markdownlint#86 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants