Semantic HTML OL vs UL in the right sidebar

That is the markup that TW generates. If you use the Web Developer tools and inspect the list, you will find

<ol class="tc-toc toc-selective-expandable">
...
</ol>

I don’t have a clue as to why; my guess would be that it’s specifically for screen readers.

1 Like

The list-widget creates an ordered list because it is “semantic HTML” code. The list-widget respects the list-field of a tag so technically it is “ordered”. It makes sense to use an OL

1 Like

It’s an interesting point. “Respects the list-field” is fine, but that field often enough is not supplied. At that point should it switch to UL?

There is a clear semantic difference between

  1. Apples
  2. Bananas
  3. Cherries

and

  • Apples
  • Bananas
  • Cherries

but the suppression of the list marker blurs that distinction quite a bit.

In any case, it’s not an important concern. Just interesting.

BTW, I love the PR. It’s a great idea.

1 Like