Skip to content

Change rule - Indented Code Blocks can interrupt a paragraph #3

@namse

Description

@namse

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

An indented code block cannot interrupt a paragraph, so there must be a blank line between a paragraph and a following indented code block. (A blank line is not needed, however, between a code block and a following paragraph.)

Why? I disagree with that spec.
For example,

asdf
    a

must be

a)
<p>asdf</p>
<pre><code>a</code></pre>

or

b)
<p>asdf
    a</p>

But the spec's answer is

b)
<p>asdf
a</p>

I cannot agree with useless indentation restriction. It must be meaningful to restrict indentation.

Conclusion

Indented Code Blocks can interrupt a paragraph

I use 4 indentation to indicate Indented Code Blocks(after parsing List item first). I mean, I think above example must be interpreted like a) case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions