Possible Bug of List and Blockquote

I am learning the implementation of commonmark.js while coming up an test case:

1. > 1. a
   > 1. b
   > 
   > 
   > 1. c  <- this should be part of the outer list

> 1. a
> 1. b
> 
> 
> 1. c <- this is the expected result

Live Example. I think the markdown-it’s output is the correct one.

While IMO it is a bug, but I don’t know what you guys think, so I post it here.

1 Like

I think you’re right, this does look like a bug. Smaller case:

1. > 1. a
   > 
   > 
   > 1. c  <- this should be part of the outer list

Could you put a bug report on jgm/cmark or jgm/commonmark.js?

Note: the “two blank lines breaks out of list” rule is under consideration for removal (see the “issues to resolve before 1.0” thread), so this might become irrelevant.

Actually, it’s not clear this is a bug. The rule (5.3) says that “two blank lines end all containing lists.” Since the outer list does contain the inner one (albeit with a blockquote intermediary), maybe the current behavior is not wrong.

In any case, this is not clear enough in the spec.

I am inclined to remove the two-blank-lines rule anyway. The complexity it adds isn’t justified by what it gives us, in my opinion.

1 Like