Firefox html ordered list numbering messed up by sublist
Asked Answered
A

2

5

My sublists suddenly started breaking my ordered lists in Firefox (68.0.2) for Ubuntu, and Firefox on my android mobile. Is this a Firefox bug or is my syntax bad here?

<ol>
  <li>Ordered list item 1</li>
  <ul>
    <li>sub bullet list item</li>
    <li>sub bullet list item</li>
    <li>sub bullet list item</li>
    <li>sub bullet list item</li>
    <li>sub bullet list item</li>
  </ul>
  <li>Ordered list item #2. Why is this appearing as 6 in Firefox?</li>
</ol>
Applecart answered 20/8, 2019 at 4:57 Comment(0)
P
2

This is indeed a new FF 68+ regression. See https://bugzilla.mozilla.org/show_bug.cgi?id=1548753

Ponder answered 4/9, 2019 at 8:20 Comment(2)
It's the markup. The sublist should be inside the <li> to be a sublist.Allahabad
Yeah, it's incorrect (or at least ambiguous) markup. But it used to be rendered the other way around, and is rendered like this in all other browsers, it seems.Floatage
E
6

The thing is, in your code ul is not inside any of your li tags. Therefore, list items of your unordered list are not subitems of any item in your ordered list. Try this instead:

<ol>
    <li>Ordered list item 1
        <ul>
            <li>sub bullet list item</li>
            <li>sub bullet list item</li>
            <li>sub bullet list item</li>
            <li>sub bullet list item</li>
            <li>sub bullet list item</li>
        </ul>
    </li>
    <li>Ordered list item #2. Why is this appearing as 6 in Firefox?</li>
</ol>
Eggleston answered 20/8, 2019 at 6:6 Comment(0)
P
2

This is indeed a new FF 68+ regression. See https://bugzilla.mozilla.org/show_bug.cgi?id=1548753

Ponder answered 4/9, 2019 at 8:20 Comment(2)
It's the markup. The sublist should be inside the <li> to be a sublist.Allahabad
Yeah, it's incorrect (or at least ambiguous) markup. But it used to be rendered the other way around, and is rendered like this in all other browsers, it seems.Floatage

© 2022 - 2024 — McMap. All rights reserved.