executablebooks / rst-to-myst

Convert ReStructuredText to MyST Markdown
https://rst-to-myst.readthedocs.io
MIT License
59 stars 10 forks source link

🐛 Lists that are indented are messed up #17

Closed mbercx closed 3 years ago

mbercx commented 3 years ago

Describe the bug

Lists that have been indented in .rst are converted in such a way that they aren't rendered properly.

To Reproduce

When trying to convert the following .rst snippet:

This is a numbered list!

#. Step 1
#. Step 2
#. Step 3
#. Step 4

This is a numbered list with indentation!

    #. Step 1
    #. Step 2
    #. Step 3
    #. Step 4

This is a regular list with indentation!

    * Step 1
    * Step 2
    * Step 3
    * Step 4

You obtain

This is a numbered list!

1. Step 1
2. Step 2
3. Step 3
4. Step 4

This is a numbered list with indentation!

> > 1. Step 1
> 2. Step 2
> 3. Step 3
> 4. Step 4

This is a regular list with indentation!

> > * Step 1
> * Step 2
> * Step 3
> * Step 4

Expected behavior

The > should probably be removed, even though this means there is no difference between the indented and non-indented case (which is different for .rst).

Environment

chrisjsewell commented 3 years ago

@mbercx have you checked how this actually renders in RST?

Because of https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#block-quotes, these indented lists will indeed be rendered as block quotes, hence the preceding > (which is the Markdown version of block quotes)

(although as of #18, the initial > > is "fixed" to only be >)

will close but gimme a shout if you still think it is a bug