All rules

Unclosed code fence

unclosed-code-fenceon by defaultJapanese / English

A code block opened with "```" and never closed

Example

Flagged
Install it first. ```sh npm install ## Check Make sure it runs.
What chaff prints
3:1 The code block opened with "```sh" is never closed
Fixed
Install it first. ```sh npm install ``` ## Check Make sure it runs.
What chaff prints
no finding

How to fix

Add a line after the code with the same character, at least as many ("```").

Why it matters

A code block opened with "```" and never closed runs to the end of the document (or of the list item it is in), so Markdown shows everything after it as code. The headings and text that follow turn into one block of monospaced text, and the document looks broken.

What it does not flag

A closed code block, an indented code block, and a code block in a quotation are not reported.

Turning it off or relaxing it

Silence this one spot (in the document)
<!-- stet: unclosed-code-fence — reason -->
Relax it for the team (the reason is kept as a comment in chaff.yaml)
npx chaffjs relax unclosed-code-fence --why "reason"
Turn it off for the team (chaff.yaml)
rules: unclosed-code-fence: off
Technical details
Layer
L1
Status
stable
Severity
warning
Languages
Japanese and English
Suited to
business, technical, blog, legal, docs, academic, literature, speech
Reads from the document
markdown

Levels

Set a level for this rule under rules in chaff.yaml. With nothing set, it runs at the level its genre gives it (see By genre below).

stricterror
normalwarning
relaxedinfo

This rule has no limit to count to. A level sets how a finding is marked: relaxed keeps the finding and marks it a step lower.

By genre

Runs by default in
technical/spec, technical/readme, blog/tech, blog/essay, blog/owned-media, business/proposal, business/report, business/email, business/press-release, business/meeting-notes, legal/contract, legal/statute, legal/judgment, legal/patent, docs/manual, docs/faq, docs/glossary, academic/paper, literature/fiction, literature/essay, literature/poetry, literature/play, speech/address, speech/transcript

Genres

Message

The code block opened with "{fence}" is never closed

Rewrite depth (chaff fix-plan --depth): light — words and sentences; the structure and the voice stay

This page is built from the rule's definition file:packages/chaff/rules/unclosed-code-fence.yaml