Tag Processor: Add Bookmark Invalidation Logic#4116
Closed
ockham wants to merge 2 commits intoWordPress:trunkfrom
Closed
Tag Processor: Add Bookmark Invalidation Logic#4116ockham wants to merge 2 commits intoWordPress:trunkfrom
ockham wants to merge 2 commits intoWordPress:trunkfrom
Conversation
3217dba to
8f43d6e
Compare
Contributor
Author
|
cc/ @dmsnell 😊 |
dmsnell
approved these changes
Feb 22, 2023
Member
dmsnell
left a comment
There was a problem hiding this comment.
Adding approval here, given that we already ran review in the Gutenberg repo.
I've also merged this into dmsnell/WordPress-develop html-api/wordpress-6.3
Contributor
Author
|
Thank you! 😊 Just noting that we can't merge this to |
hellofromtonya
approved these changes
Mar 16, 2023
Contributor
hellofromtonya
left a comment
There was a problem hiding this comment.
- Confirmed this is a copy of Gutenberg PR 47559 ✅
- Includes ticket annotation in tests ✅
- Includes
@sinceannotation ✅
Ready for commit 👍
Contributor
|
Prepping commit now ✅ |
Contributor
Contributor
Author
|
Thank you very much for landing this @hellofromtonya ! |
dmsnell
added a commit
to WordPress/gutenberg
that referenced
this pull request
Apr 20, 2023
- Support a few extra invalid comment syntaxes. WordPress/wordpress-develop#4256 - Invalidate bookmarks which have been eliminated by enqueued changes. WordPress/wordpress-develop#4116 - Expose whether the currently-matched tag has the self-closing flag. WordPress/wordpress-develop#4266 - Avoid double-writing an attribute value if given case-variations of the name. WordPress/wordpress-develop#4337
dmsnell
added a commit
to WordPress/gutenberg
that referenced
this pull request
Apr 21, 2023
- Support a few extra invalid comment syntaxes. WordPress/wordpress-develop#4256 - Invalidate bookmarks which have been eliminated by enqueued changes. WordPress/wordpress-develop#4116 - Expose whether the currently-matched tag has the self-closing flag. WordPress/wordpress-develop#4266 - Avoid double-writing an attribute value if given case-variations of the name. WordPress/wordpress-develop#4337 - Linting updates from WordPress/wordpress-develop#4360.
dmsnell
added a commit
to WordPress/gutenberg
that referenced
this pull request
Apr 24, 2023
- Support a few extra invalid comment syntaxes. WordPress/wordpress-develop#4256 - Invalidate bookmarks which have been eliminated by enqueued changes. WordPress/wordpress-develop#4116 - Expose whether the currently-matched tag has the self-closing flag. WordPress/wordpress-develop#4266 - Avoid double-writing an attribute value if given case-variations of the name. WordPress/wordpress-develop#4337 - Linting updates from WordPress/wordpress-develop#4360. - Avoid losing previous updates in certain cases when seeking earlier in a document. WordPress/wordpress-develop#4345
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Targeting WP 6.3.
While
WP_HTML_Tag_Processorcurrently only supports changing a given tag's attributes, we plan to also provide methods to make broader changes (possibly through a subclass ofWP_HTML_Tag_Processor).An API like that will have the potential of replacing a tag that a bookmark points to. As a preparation, we thus need to make sure that all bookmarks affected by a HTML replacement are invalidated (i.e. released).
This is done by extending the existing loop in
apply_attributes_updatesthat adjusts bookmarks' start and end positions upon HTML changes to check if the entire bookmark is within a portion of the HTML that has been replaced.Note that this PR is a backport of WordPress/gutenberg#47559.
Trac ticket: https://core.trac.wordpress.org/ticket/57788
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.