Skip to content

Don't add newline after a nested list#680

Closed
Convincible wants to merge 2 commits intogettalong:masterfrom
Convincible:patch-2
Closed

Don't add newline after a nested list#680
Convincible wants to merge 2 commits intogettalong:masterfrom
Convincible:patch-2

Conversation

@Convincible
Copy link
Contributor

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
Contributor 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
Contributor 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.

@gettalong
Copy link
Owner

Thanks! I have added a test case and this will be in the next release.

@cabo FYI Next release within a week.

@gettalong gettalong closed this Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants