commonmark / commonmark-spec-web

CommonMark spec web pages

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing requirement regarding code blocks in specs/doc

gingerbeardman opened this issue · comments

http://spec.commonmark.org/0.28/#indented-code-blocks

4.4 An indented code block is composed of one or more indented chunks separated by blank lines.

Specifically missing is the requirement that for markdown to be interpreted as a code block, it must be fenced also by blank lines.

FWIW, the code generated by CommonMark is valid. So this is just a documentation oversight.

glushchenko/fsnotes#125 (comment)

the requirement that for markdown to be interpreted as a code block, it must be fenced also by blank lines.

But this isn't true.

# Header
    code
# Header

gives you a code block. What is true is that an indented code block can't interrupt a paragraph. And that is documented, in the second paragraph of the section.

An indented code block cannot interrupt a paragraph, so there must be a blank line between a paragraph and a following indented code block.