EditorConfig for Markdown
I am using the basic EditorConfig configuration for Markdown files.
[*.md] trim_trailing_whitespace = true indent_style = space
I trim trailing whitespace to adhere to Markdownlint recommendations for “Trailing spaces” (MD009). Do note that this conflicts with the Markdown specification for inserting a line break, by ending a line with two consecutive spaces, so of you need this particular Markdown feature, you should disable:
[*.md] trim_trailing_whitespace = false
Currently I do this in my global file (
$HOME/.editorconfig) so I do not have any surprises, when just editing Markdown and then on a project or repository basis I enable it where the Markdownlint rules makes more sense.
I use indentation style based on spaces, to adhere to Markdownlint recommendations for “Unordered list indentation” (MD007).