Skip to content

Table of Contents: Add Bulleted lists and optional hierarchical numbering#71176

Open
Sukhendu2002 wants to merge 2 commits intoWordPress:trunkfrom
Sukhendu2002:feat/toc-bullets-and-hierarchical-numbering
Open

Table of Contents: Add Bulleted lists and optional hierarchical numbering#71176
Sukhendu2002 wants to merge 2 commits intoWordPress:trunkfrom
Sukhendu2002:feat/toc-bullets-and-hierarchical-numbering

Conversation

@Sukhendu2002
Copy link
Contributor

@Sukhendu2002 Sukhendu2002 commented Aug 12, 2025

What?

Part of: #41769

Adds a list style option (Numbers/Bullets) to the Table of Contents block.
Adds an optional hierarchical numbering mode for ordered lists (e.g., 2.1, 2.1.1) using CSS counters.

Testing Instructions

  1. Create a new post and insert a “Table of Contents” block.
  2. Add multiple Heading blocks (e.g., H2, H3 nested under an H2, H4 nested under that H3).
  3. In Inspector Controls, change “List style” from Numbers → Bullets.
  4. Expected:
    • ToC rerenders as an unordered list.
    • The “Hierarchical numbering” toggle is hidden and its value is reset to false.
  5. Change Bullets → Numbers.
    • ToC rerenders as an ordered list.
    • “Hierarchical numbering” toggle is visible again and remains off.
  6. With “List style” = Numbers, enable “Hierarchical numbering”.
  7. Ensure your post has nested headings (H2 → H3 → H4).
  8. Expected:
    • Nested items display composite numbering via CSS counters (e.g., 2.1, 2.1.1).

Screenshots or screencast

Screen.Recording.2025-08-12.at.5.51.46.PM.mov

@Sukhendu2002 Sukhendu2002 marked this pull request as ready for review August 12, 2025 17:06
@github-actions
Copy link

github-actions bot commented Aug 12, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Sukhendu2002 <sukhendu2002@git.wordpress.org>
Co-authored-by: jasmussen <joen@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@ryanwelcher ryanwelcher added [Type] Enhancement A suggestion for improvement. [Block] Table of contents (experimental) Affects the Table of contents Block labels Aug 12, 2025
@mtias mtias added the Needs Design Feedback Needs general design feedback. label Aug 14, 2025
@jasmussen
Copy link
Contributor

Good PR. It seems valid enough as a small improvement. The closest we have designwise is this older issue: #51480

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Table of contents (experimental) Affects the Table of contents Block Needs Design Feedback Needs general design feedback. [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants