Skip to content

markdown

Markdown files: the markdownlint rules, and code blocks that parse. Guide: Markdown.

A scope has file extensions .md or .mdx. Also when mkdocs requires it.

Checks the headings, lists, and spacing of every Markdown file.

Runs at the commit stage, with markdownlint-cli2. gspot check --fix fixes what it can.

Consistent Markdown renders the same in every viewer.

Run the fix: command that the report prints for the rules that fix themselves; read the rule name for the rest.

A heading that jumps from level one to level three reports MD001. Change the later heading to level two.

gspot ignore markdown/markdownlint --paths "<path>" --reason "<why>"
gspot ignore markdown/markdownlint --rule <rule> --reason "<why>"

To silence one place, write a comment such as:

<!-- markdownlint-disable-next-line MD013 -- reason: the table row cannot wrap -->

Checks the code blocks of Markdown and MDX files for syntax errors.

Runs at the commit stage.

A code block that fails to parse shows readers a program that cannot run.

Fix the code, or label the block text when it holds prose.

A bash fence with if then reports a syntax error. Correct the Bash, or label the block text when it holds no code.

gspot ignore markdown/fences --paths "<path>" --reason "<why>"
Setting What it sets
tools.markdownlint.rules Option tables by Markdown rule ID, such as MD024; the level decides which rules run. Ignore a finding with gspot ignore markdown/markdownlint --rule <rule> --reason "<why>".
Tool Version
markdownlint-cli2 0.24.0

.markdownlint.jsonc, .gspot/configurations/markdown/markdownlint.jsonc, and .gspot/configurations/markdown/markdownlint-cli2.mjs