-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Document Outline: add support for heading elements outside of core Heading blocks #29610
Document Outline: add support for heading elements outside of core Heading blocks #29610
Conversation
Size Change: +128 B (0%) Total Size: 1.05 MB
ℹ️ View Unchanged
|
b074e90
to
3a523bb
Compare
I can't get the last unit test to pass, despite the described behavior working fine in my manual testing. Any ideas?
|
3a523bb
to
106714a
Compare
Since we decided in #29560 that the Table of Contents block should only support other blocks when gathering headings, I think it's safe to assume similar reasoning applies here. In other words, it's not worth the added complexity to support headings outside of the Heading block (and perhaps other core blocks). |
@ZebulanStanphill is there a hook to override the content being analyzed in the outline structure? As an agency developer making client sites, we severely limit the allowed blocks and use a component-driven workflow where custom blocks all control the specific heading tags. I'm now getting asked by our clients' SEO teams why the "Outline" tab is broken in the List View. |
Description
Previously, the Document Outline only accounted for core Heading blocks. This PR adds support for heading elements in any other block, as long as that block includes the heading tags in its save implementation.
How has this been tested?
I tested to make sure that heading elements inside a Custom HTML block were listed in the Document Outline, and I confirmed that all the warnings appeared when appropriate. I also tested to make sure that clicking the entries in the Document Outline would jump to the block containing that heading.
Screenshots
Checklist: