Vscode: Trim Trailing Whitespace Breaks Markdown

Created on 28 Dec 2015  路  4Comments  路  Source: microsoft/vscode

When this is set to true

"files.trimTrailingWhitespace": true

trailing spaces get removed at the end of the line in md/markdown files. By default, two spaces in markdown is the same as a <br>. When saving the file with that setting, those two spaces get removed and it changes the output of the markdown.

Most helpful comment

Successfully disabled files.trimTrailingWhitespace for Markdown using language specific settings.
Snippet from my settings.json:

    "files.trimTrailingWhitespace": true,
    "[markdown]": {
        "files.trimTrailingWhitespace": false
    },

All 4 comments

Well I think we need language specific setting overrides which we have a feature request already for.

@bpasero could you link to the other feature request to make it easy to find? Not sure whether this issue has been fixed!

I think you can use the editor-config extension to configure this now (https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig)

Successfully disabled files.trimTrailingWhitespace for Markdown using language specific settings.
Snippet from my settings.json:

    "files.trimTrailingWhitespace": true,
    "[markdown]": {
        "files.trimTrailingWhitespace": false
    },
Was this page helpful?
0 / 5 - 0 ratings

Related issues

lw-schick picture lw-schick  路  229Comments

hsdk123 picture hsdk123  路  263Comments

niagr picture niagr  路  246Comments

mariusa picture mariusa  路  219Comments

ghost picture ghost  路  234Comments