Opened 5 years ago
Closed 5 years ago
#4406 closed defect (bug) (fixed)
Avoid duplicate anchors when generating table of contents in the Handbook
Reported by: | garrett-eclipse | Owned by: | coffee2code |
---|---|---|---|
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
In 8899: