wasi-master / rich-rst

A reStructuredText renderer for rich
https://rich-rst.readthedocs.io/en/latest/
MIT License
13 stars 3 forks source link

List output is mediocre #2

Open wasi-master opened 2 years ago

wasi-master commented 2 years ago

So the current implementation of enumerated/bulleted list parsing is not optimal and has many flaws.

https://github.com/wasi-master/rich-rst/blob/00032d8983a1b6f1d3c77668616ea5bbd33497ec/rich_rst/__init__.py#L236-L264

This needs to be re-written to allow unlimited nesting and any elements.\ Currently, as it stands, it just prints out the contents of the list as text, without parsing the nested elements. Because of this, if you let's say, have a list containing a code block (literal block in rst), then the contents would be printed as plain text, instead of being printed with syntax highlighting. I am hoping for a recursive solution that would allow lists and nested lists to have any kind of elements inside of them.

Currently, I don't have sufficient time for this so I am creating this issue to shine some light on the topic and get input from the community. You can discuss anything in the comments and I'll try my best to help