WordPress.org

Making WordPress.org

Opened 4 weeks ago

Last modified 4 weeks ago

#4406 new defect

Avoid duplicate anchors when generating table of contents in the Handbook

Reported by: garrett-eclipse Owned by:
Milestone: Priority: normal
Component: Handbooks Keywords:
Cc:

Description

Hello,

As suggested by @sergey in Slack I'm opening this ticket to address the duplicate anchors that can occur when the same heading is used multiple times in a document.

For instance originally the Working with Patches document had several 'Applying a Patch' references which all anchored to '#applying-a-patch' so they'd all lead to the first item.

I've addressed this by manually making all the headings unique for this page;
https://make.wordpress.org/core/handbook/tutorials/working-with-patches/

It was indicated the code for this is located here;
https://meta.trac.wordpress.org/browser/sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/inc/table-of-contents.php

All the best,
Cheers

Change History (1)

This ticket was mentioned in Slack in #core-docs by garrett-eclipse. View the logs.


4 weeks ago

Note: See TracTickets for help on using tickets.