Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't add newline after a nested list #680

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Don't add newline after a nested list #680

wants to merge 2 commits into from

Conversation

Convincible
Copy link

Checks whether element is a list, and if that list is nested within another list (i.e. the list's parent is a list item). In this case we should not add another newline.

The change results in nested lists appearing as:

* First item
  * Sub item 1
    * Sub sub item
  * Sub item 2
* Second item
  * Sub item

rather than:

* First item
  * Sub item 1
    * Sub sub item

  * Sub item 2

* Second item
  * Sub item

Element opts hash carrying info about the parent is generally useful.

Immediate use case is simple fix for a bug where nested lists don't realise they are nested, and hence newlines are added after the end of a nested list (within the main list) when this is of course unnecessary and can cause rendering issues.
@Convincible
Copy link
Author

Now properly using the @stack variable

@gettalong gettalong self-assigned this Jul 21, 2020
@gettalong
Copy link
Owner

Thank you - I will have a more in-depth look later!

@Convincible
Copy link
Author

Has this bug been fixed @gettalong ?

@gettalong
Copy link
Owner

@Convincible No, this change is not yet included but looks good! Please add some test and then it is good to go - thanks!

@cabo
Copy link
Contributor

cabo commented Apr 21, 2024

@Convincible No, this change is not yet included but looks good! Please add some test and then it is good to go - thanks!

Where would such a test go?
I'd really like to have this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants