Skip to content

HTML API: Implement active format reconstruction - #13

Closed
dmsnell wants to merge 8 commits into
trunkfrom
html-api/improve-active-element-reconstruction
Closed

HTML API: Implement active format reconstruction#13
dmsnell wants to merge 8 commits into
trunkfrom
html-api/improve-active-element-reconstruction

Conversation

@dmsnell

@dmsnelldmsnell commented Jan 13, 2024

Copy link
Copy Markdown
Owner

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 browserHTML Breadcrumbs
Screenshot 2024-01-13 at 9 29 32 AMScreenshot 2024-01-13 at 9 30 03 AM

@@ -1472,15 +1472,19 @@ private function generate_implied_end_tags_thoroughly() {
* @return bool Whether any formatting elements needed to be reconstructed.

Copy link
Copy Markdown
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
Copy Markdown
OwnerAuthor

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
dmsnellforce-pushed the html-api/add-support-for-most-of-the-rest-of-the-common-tags branch 3 times, most recently from 89a226f to 7939dcbCompareJanuary 20, 2024 00:18
@dmsnell
dmsnellforce-pushed the html-api/improve-active-element-reconstruction branch from f412732 to 55e20cfCompareJuly 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 trunkJuly 2, 2024 22:33
@dmsnell

Copy link
Copy Markdown
OwnerAuthor

Superseded by WordPress#6982

@dmsnelldmsnell closed this Jul 6, 2024
Sign up for freeto 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.

2 participants

@dmsnell@sirreal