jgm/peg-markdown

Does not switch properly between ordered list and unordered list

dephiros opened this issue · 4 comments

For the following case mmd does not do what i expect:

1. abcd

   - 1adsdfa

   - asfda

2. abdc

    1. bcd

    2. bcd

3. abcd

    - bcd

I get:

  1. abcd

  2. 1adsdfa

  3. asfda

  4. abdc

    1. bcd

    2. bcd

  5. abcd

    • bcd

instead of:

  1. abcd

    • 1adsdfa

    • asfda

  2. abdc

    1. bcd

    2. bcd

  3. abcd

    • bcd
jgm commented

This is entirely unhelpful unless I know what you expect.

By the way: peg-markdown obeys the "four space rule": you
must indent four spaces to get a sublist.

+++ dephiros [Apr 09 13 17:54 ]:

For the following case mmd does not do what i expect:

  1. abcd

    1. abdc
      1. abcd


    Reply to this email directly or [1]view it on GitHub.
    [xJAuenYDiIoVt3LF3y68497H2mFL3E-qD00lFgfRxSxLslcKolaQE9rdKQj-MpdN.gif]

References

  1. #23

@jgm Sorry for that. I have updated the issues. Maybe I am still new at mmd but nested list in mmd is a little bit unexpected.
I found a fix for the problem above by indenting everything by 4 spaces
Anther similar markdown document I have actually mess up the last unordered list instead of the first 2 unordered lists

jgm commented

Implementations really vary on how much indentation they require,
and the spec is vague on this.

http://johnmacfarlane.net/babelmark2/?normalize=1&text=-+top%0A+-+indented+one%0A++-+indented+two%0A+++-+indented+three%0A++++-+indented+four%0A+++++-+indented+five%0A

If you indent four spaces, you can be sure it will work in all
implementations.

+++ dephiros [Apr 10 13 14:05 ]:

[1]@jgm Sorry for that. I have updated the issues. Maybe I am still new
at mmd but nested list in mmd is a little bit unexpected.
I found a fix for the problem above by indenting everything by 4 spaces
Anther similar markdown document I have actually mess up the last
unordered list instead of the first 2 unordered lists

--
Reply to this email directly or [2]view it on GitHub.
[xJAuenYDiIoVt3LF3y68497H2mFL3E-qD00lFgfRxSxLslcKolaQE9rdKQj-MpdN.gif]

References

  1. https://github.com/jgm
  2. #23 (comment)

Thank you