Skip to content

markdown/fences

Checks JSON, JSONC, TOML, YAML, Bash, JavaScript, JSX, TypeScript, TSX, and Python code fences in Markdown (.md) files for syntax errors.

Part of the markdown configuration, at the recommended level. It runs at the commit stage, per file. gspot runs this check itself.

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.

Turn it off for some files, with a reason:

gspot ignore markdown/fences --paths "<glob>" --reason "<why>"