[wp-meta] [Making WordPress.org] #5963: ToC plugin doesn't support Gutenberg

Making WordPress.org noreply at wordpress.org
Thu Nov 25 01:11:06 UTC 2021

#5963: ToC plugin doesn't support Gutenberg
 Reporter:  dd32       |       Owner:  dd32
     Type:  defect     |      Status:  closed
 Priority:  normal     |   Milestone:
Component:  Handbooks  |  Resolution:  fixed
 Keywords:             |
Changes (by dd32):

 * status:  assigned => closed
 * resolution:   => fixed


 In [changeset:"11341" 11341]:
 #!CommitTicketReference repository="" revision="11341"
 Handbooks, ToC: Update the TOC generation to support Gutenberg usage.

 In gutenberg, the headings automatically have IDs present, and can have
 `class` and `style` attributes which also didn't work with the plugin.

 This change alters how markup is generated significantly by generating IDs
 once per `the_content` call, and makes use of named matching groups for

 This change means that:
  - It works with Gutenberg header blocks including `id=..`
  - Custom IDs can be specified for headings (In the Advanced panel in
 Gutenberg) to avoid changing the ID when changing the title
  - Headings can be styled inside Gutenberg and it'll still be presented
 correctly in the ToC markup (both `style` and `class` attributes)

 Fixes #5963.

Ticket URL: <https://meta.trac.wordpress.org/ticket/5963#comment:1>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org

More information about the wp-meta mailing list