Skip to content
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

HTML API: Scan to end of tag when getting updated HTML output. #5506

Closed

Conversation

dmsnell
Copy link
Contributor

@dmsnell dmsnell commented Oct 17, 2023

Trac ticket: https://core.trac.wordpress.org/ticket/59643

Fixes a bug introduced in #5475.

When applying updates to HTML, one step was left out in #5475 which updated the position of the end of the current tag. This made it possible to create bookmarks with null or earlier end positions than their start position. This in turn broke the Directive Processor in Gutenberg during the backport of changes from Core into Gutenberg.

In this patch, after applying updates, the HTML document is now scanned fully to the end of the current tag, updating the internal pointer to its end, so that nothing else will be broken or misaligned.

cc: @ramonjd @andrewserong

Fixes a bug introduced in WordPress#5475.

When applying updates to HTML, one step was left out in WordPress#5475 which
updated the position of the end of the current tag. This made it
possible to create bookmarks with null or earlier end positions than
their start position. This in turn broke the Directive Processor in
Gutenberg during the backport of changes from Core into Gutenberg.

In this patch, after applying updates, the HTML document is now scanned
fully to the end of the current tag, updating the internal pointer to
its end, so that nothing else will be broken or misaligned.
@SergeyBiryukov
Copy link
Member

Thanks for the PR! Merged in r56953.

@dmsnell dmsnell deleted the fix/html-api/update-tag-end-position branch October 17, 2023 16:44
@dmsnell
Copy link
Contributor Author

dmsnell commented Oct 17, 2023

Thank you @SergeyBiryukov for picking this up and moving it forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants