Markdown formatting I came across that doesn't work "right"


(Michael Brown) #1

variant one

1. List item

1. Commented block below

<!--
1. Commented item 1

1. Commented item 2
-->

1. Another list item
  1. List item

  2. Commented block below

  1. Another list item (should be numeric, not bullet)

variant two

1. List item

1. Commented block below

<!--
1. Commented item 1

Commented item 2 (non-list)
-->

1. Another list item
  1. List item

  2. Commented block below

  1. Another list item (which should be 3)

and this is for @eviltrout:


(Jeff Atwood) #2

Did you test them on babelmark?

I don’t think you did, because case #2 is invalid. Case #1 looks like a valid complaint, however.

I wish the source library we used had tested itself against the standard MDTest suite… here’s the input files to be verified against standard output files


(Michael Brown) #3

I hadn’t even known that existed.

Interesting results removing the spaces - seems to confuse a lot of parsers:

1. List item
1. Commented block below
<!--
1. Commented item 1
1. Commented item 2
-->
1. Another list item

But ours handles it right:

  1. List item
  2. Commented block below
  1. Another list item

But if we change what’s inside the commented block, it gets odd:


1. List item
1. Commented block below
<!--
1. Commented item 1
1. Commented item 2

-->
1. Another list item
  1. List item
  2. Commented block below
  1. Another list item

1. List item
1. Commented block below
<!--
1. Commented item 1

1. Commented item 2

-->
1. Another list item
  1. List item
  2. Commented block below
  1. Another list item

(Jeff Atwood) #4

Looks correct now. In your first example where it says “should be numeric, not bullet” is indeed a number. And the second example isn’t really valid.


(Jeff Atwood) #5