Skip to content

Conversation

@dmsnell
Copy link
Owner

@dmsnell dmsnell commented Jan 13, 2024

Trac ticket: Core-61576

Adds support for active format reconstruction, which occurs when crossing certain HTML boundaries, such as when entering a new P element which implicitly closed the previous one and all of the formatting elements inside it.

This raises the question what to do when elements are implicitly created. This appears already with the unexpected </p>, which creates an empty P element. next_tag() never finds these elements even though they appear in the breadcrumbs when moving past them.

<p><b>This is bold<p>This is a new paragraph, and it's still bold.
DOM in browser HTML Breadcrumbs
Screenshot 2024-01-13 at 9 29 32 AM Screenshot 2024-01-13 at 9 30 03 AM

*
* @see https://html.spec.whatwg.org/#reconstruct-the-active-formatting-elements
*
* @return bool Whether any formatting elements needed to be reconstructed.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if false | int would be helpful, where we could return false or the number of reconstructed elements.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you think of a case where it would be useful?

@dmsnell dmsnell force-pushed the html-api/add-support-for-most-of-the-rest-of-the-common-tags branch 3 times, most recently from 89a226f to 7939dcb Compare January 20, 2024 00:18
@dmsnell dmsnell force-pushed the html-api/improve-active-element-reconstruction branch from f412732 to 55e20cf Compare July 2, 2024 22:33
@dmsnell dmsnell changed the base branch from html-api/add-support-for-most-of-the-rest-of-the-common-tags to trunk July 2, 2024 22:33
@dmsnell
Copy link
Owner Author

dmsnell commented Jul 6, 2024

Superseded by WordPress#6982

@dmsnell dmsnell closed this Jul 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants