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.
Installation
go install github.com/shurcooL/markdownfmt@latest
Usage
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