Open jmcmaster05 opened 5 years ago
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
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: https://github.com/DavidAnson/vscode-markdownlint/issues/86#issuecomment-579860824
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
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. 😞Please let me know if I've overlooked a setting or if you are aware of a better solution. I've researched https://github.com/neilsustc/vscode-markdown/issues/155