wasi-master / rich-rst

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

Remove trailing empty Text() objects that get displayed as newlines. #14

Closed BrianPugh closed 4 months ago

BrianPugh commented 4 months ago

hey @wasi-master! Sorry for the PR churn, but I found another occurence of trailing newlines. This time its whenever bullet/enumerated lists are the last element rendered, as they finalize in an empty Text() object. The new code detects that and removes trailing empty Text() objects (technically, I replaced it with the slightly more appropriate console.NewLine object for the EDIT reason below).

EDIT: Also now fixed missing newlines after bullet points. Consider the following RST text:

        The following are bulletpoints:

        * bulletpoint 1
        * bulletpoint 2

        This is normal text.

How it got rendered before: Screenshot 2024-04-26 at 8 46 53 AM

How it gets rendered now: Screenshot 2024-04-26 at 8 46 43 AM

BrianPugh commented 4 months ago

Hey @wasi-master, any chance we can get this merged in soon and get a patch release? This is the last known bug before I can release a new version of Cyclopts. Thanks!

Also, if you are looking for additional maintainers, I'd be more than happy to help out 😄 .

wasi-master commented 4 months ago

Thank you, The thing with rst is that I do not use rst that much in my day-to-day life so testing this is really up to the community. I am grateful for people like you who are helping me find bugs

wasi-master commented 4 months ago

Done