commonmark.js icon indicating copy to clipboard operation
commonmark.js copied to clipboard

Putting slighlty misaligned blockquote in a list

Open BigBadaboom opened this issue 10 years ago • 5 comments

Is the following a bug in commonmark.js? The behaviour seems to disobey rule 4 of List Items.

 > Blockquote
> continued here.


1.  > Blockquote
   > continued here.

Dingus here.

BigBadaboom avatar Jul 22 '15 23:07 BigBadaboom

Rule 4 says: " If a sequence of lines Ls constitutes a list item according to rule #1, #2, or #3, then the result of indenting each line of Ls by 1-3 spaces (the same for each line) also constitutes a list item with the same contents and attributes." I don't see how this applies here. Your list item is not indented.

jgm avatar Jul 23 '15 16:07 jgm

Sorry. Please close this. It was the result of a late night brain fail on my part.

BigBadaboom avatar Jul 24 '15 03:07 BigBadaboom

As far as I can see, the current behavior respects all of the spec's list rules. However, it does violate an invariant I'd hoped to achieve, the Principle of Uniformity. So it might be worth thinking about how the spec might be adjusted to allow this case to have its more natural interpretation.

jgm avatar Jul 25 '15 15:07 jgm

Here is another, similar violation of the principle of uniformity: http://spec.commonmark.org/dingus/?text=%20%20oo%0A--%0A%0A-%20%20%20oo%0A%20%20--%0A

jgm avatar Jul 25 '15 15:07 jgm

Maybe also: http://spec.commonmark.org/dingus/?text=%20%20%23%20hi%0A%0Aok%0A%0A-%20%20%20%23%20hi%0A%0A%20%20ok%0A

jgm avatar Jul 25 '15 15:07 jgm