Like gofmt, but for Markdown.

Note that markdownfmt works with pure Markdown files. If you want to use it with Markdown files that have front matter, consider one of alternatives that supports that.
go install github.com/shurcooL/markdownfmt@latest
usage: markdownfmt [flags] [path ...]
-d display diffs instead of rewriting files
-l list files whose formatting differs from markdownfmt's
-w write result to (source) file instead of stdout
mdfmt - Fork of markdownfmt that adds front matter support.tidy-markdown - Project with similar goals, but written in JS and based on a slightly different styleguide.703 followers · starred Apr 2019
13,862 followers · starred Jun 2016
1,110 followers · starred Aug 2020
2,749 followers · starred Feb 2019
Go
100.0%
Like gofmt, but for Markdown.

Note that markdownfmt works with pure Markdown files. If you want to use it with Markdown files that have front matter, consider one of alternatives that supports that.
go install github.com/shurcooL/markdownfmt@latest
usage: markdownfmt [flags] [path ...]
-d display diffs instead of rewriting files
-l list files whose formatting differs from markdownfmt's
-w write result to (source) file instead of stdout
mdfmt - Fork of markdownfmt that adds front matter support.tidy-markdown - Project with similar goals, but written in JS and based on a slightly different styleguide.703 followers · starred Apr 2019
13,862 followers · starred Jun 2016
1,110 followers · starred Aug 2020
2,749 followers · starred Feb 2019
Go
100.0%