Why is the blockquote split into two in this case?

See this commonmark.js dingus:

>     foo
> bar
> baz

Versus this commonmark.js dingus:

>     foo
\> bar
> baz

Why is the line containing bar in the second case not part of the blockquote?

I would have expected this to result in one blockquote in both cases.

Your question boils down to why the following two examples don’t produce the same HTML:

  1. >     code
    > bar
    
  2. >     code
    bar
    

The answer lies in how the spec defines laziness in block quotes:

Laziness. If a string of lines Ls constitute a block quote with contents Bs, then the result of deleting the initial block quote marker from one or more lines in which the next non-space character after the block quote marker is paragraph continuation text is a block quote with Bs as its content. Paragraph continuation text is text that will be parsed as part of the content of a paragraph, but does not occur at the beginning of the paragraph.

So the second example doesn’t work because bar “occurs at the beginning of the paragraph”, and is not “part of the content of a pragraph”, as it is in the following (and this) example:

> foo
bar
2 Likes

Thank you. I misinterpreted the definition of laziness in block quotes.

Your reply made it perfectly clear!

2 Likes