-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The h4 headings are not listed in the toc generated #4
Comments
Confirmed. Initially, it looked like h4s headings might have been a fallback, as they will appear if there are no h3s. However a closer look shows this is a bug for sure. table-of-contents/table-of-contents.php Line 52 in 5b3da29
This union operator means a) we'll end up with a weird TOC if there are more h4s than h3s and b) the original order won't be maintained. I'm working on a few general updates in my fork, here's a changeset that will make the headings used for the TOC filterable. In my fork, h3 is kept as the default heading to use in the TOC. h4s are ignored altogether. To add additional headings, a filter can be used:
If you have a chance to test out my change, that would be great! I'll work on getting my fork's updates merged over here properly. |
Hi, thanks for this fix, however, this fix only worked when there is no Gutenberg align style applied on the headings, for example, when you add heading h3 and change the block align style into a center, this TOC won't generate this heading, this also same when you add these headings into a group block. |
I think that's technically a separate issue, so I've created issue #10 to track that. |
The TOC only generate the h3 headings tag, the h4 headings are not listed in the TOC generated
The text was updated successfully, but these errors were encountered: