-
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
Rich Text: Apply attributes properly #15070
Conversation
}, | ||
{ | ||
current: '<span data-1="" data-2="">b</span>', | ||
future: '<span>b</span>', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case anyone was wondering, this test case would fail in master
. Added a comment: https://github.com/WordPress/gutenberg/pull/15070/files#diff-829f9f4e942450ee8c33f082c016b173R212.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @technote-space! I cleaned up the tests a bit so it's easier to see what is happening. I also swapped out the reverse for
loop for a simpler while
loop.
Alternatively we could have copied the attributes to an array, but the reverse loop is faster. :) |
Description
This PR fixes #14858
How has this been tested?
This test will cover this section
https://github.com/WordPress/gutenberg/blob/release/5.5/packages/rich-text/src/to-dom.js#L206-L230
before fix:
after fix:
Screenshots
before
after
Types of changes
Bug fix
Checklist: