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

Bullet lists inside enumerated lists are broken, except Arabic #484

Open
TBBle opened this issue Nov 20, 2017 · 7 comments
Open

Bullet lists inside enumerated lists are broken, except Arabic #484

TBBle opened this issue Nov 20, 2017 · 7 comments
Labels
Bug A bug Needed: patch A pull request is required

Comments

@TBBle
Copy link

TBBle commented Nov 20, 2017

Issue #118 fixed bullet lists inside enumerated lists when they are using arabic numbers, but the other forms of list numbering have the same issue.

Given:

Demonstration of nesting bullet lists inside enumerated lists
=============================================================

For reference, see `Bullet Lists`_ and `Enumerated Lists`_.

* A bullet list

  * A nested bullet list

#. An auto-numbered list

   * A nested bullet list

1. An explicity-arabic list

   * A nested bullet list

A. An explicity-uppercase alphabet list

   * A nested bullet list ==> **It has uppercase alphabet**

a. An explicity-lowercase alphabet list

   * A nested bullet list ==> **It has lowercase alphabet**

I. An explicity-uppercase roman list ==> **It has arabic**

   * A nested bullet list

i. An explicity-lowercase roman list ==> **It has arabic**

   * A nested bullet list

.. _Bullet Lists: http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#bullet-lists
.. _Enumerated Lists: http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#enumerated-lists

As noted, the fourth and fifth nested bullet lists get their parent list-style instead of their own list-style.

The bug appears to be that the fix applied in #118 (54a48b1) only applied changes to the ol.arabic rules in theme.css, not the ol.loweralpha and ol.upperalpha rules.

Also shown in this repro-case, Roman (upper and lower) lists don't get styled, and they also don't suffer the bug.

Rather than trying to match rules by ol ul li and ul ol li etc, would it make sense to give ul a class of their own, and then match that to style the li contained within? I guess that is a Sphinx issue rather than a theme issue though?

@TBBle
Copy link
Author

TBBle commented Nov 20, 2017

As a local workaround, I added the following to some custom CSS, based on the fix to #118

.rst-content ol.loweralpha li ul{margin-bottom:0 !important}
.rst-content ol.loweralpha li ul li{list-style:disc !important}
.rst-content ol.upperalpha li ul{margin-bottom:0 !important}
.rst-content ol.upperalpha li ul li{list-style:disc !important}

@Blendify Blendify added Bug A bug Needed: patch A pull request is required labels Dec 18, 2017
@eric-wieser
Copy link

The css selector applying the letters should be ol.loweralpha > li, not ol.loweralpha li

@TBBle
Copy link
Author

TBBle commented Jan 17, 2018

Is that also true of the existing ol.arabic li rules? Should they be changed to ol.arabic > li?

@eric-wieser
Copy link

Yes, all of the ol li selectors should be changed to ol > li. To be clear, I'm commenting on the package itself, not your workaround above.

@engineervix
Copy link

Is there any headway in fixing this bug?

@eric-wieser
Copy link

This needs a patch at snide/wyrm@8250cec#comments

eric-wieser added a commit to eric-wieser/wyrm that referenced this issue Jul 29, 2018
Without child selectors, the `ul li` styles would be applied to `ul li ol li`, which makes numbering disappear.

`li`s should always be selected via a child selector. `ul` and `ol` do not need to be.
@Blendify
Copy link
Member

Unfortunately, I do not see WYRM being updating so we would either have to hack a fix into our theme, fork WYRM or use something different than WYRM (#544)

sambacha added a commit to sambacha/wyrm that referenced this issue Sep 11, 2021
Without child selectors, the `ul li` styles would be applied to `ul li ol li`, which makes numbering disappear.

`li`s should always be selected via a child selector. `ul` and `ol` do not need to be.

Co-authored-by: Eric Wieser <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug Needed: patch A pull request is required
Projects
None yet
Development

No branches or pull requests

4 participants