-
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
Tests: Run block fixtures through KSES. #35611
Conversation
d38b8a4
to
1bce329
Compare
Is KSES removing all images encoded as data? Do we ever inline images in the block editor? Is that a concern? Other than that, it looks like a nice addition to the verification process 👍 |
The If the block editor was storing inline images, we probably would've heard about it by now. (I'm looking forward to this comment coming back to bite me in the future. 😛) |
I know that the block editor uses |
Ugh, we probably need to figure out a different way to do it, the |
Those fixtures are no longer used with e2e tests so it might be no longer a limitation. The other option could be to run another rule in |
1bce329
to
27f4078
Compare
This reverts commit 27f4078.
Modify the data: URLs before processing them, instead of changing all the fixtures.
fccadd3
to
89c7531
Compare
Great, let's move forward with this PR. We could add a similar test case in WordPress core, but we don't have the same test fixtures there. Maybe, it's enough to have full coverage in the plugin since we sync the code from here anyway. |
I think coverage in the plugin is fine, as long as there's a process to ensure that simple changes to KSES that can be done in the plugin (eg, adding a new tag or attribute through the |
Description
#34738 noted that the PDF embed feature produces HTML that KSES strips for non-admin users.
In order to help avoid this in the future, we should run block fixtures through KSES, to ensure they produce HTML that won't be stripped when a post is saved.
Note: This PR requires WP54261 in order to pass.
How has this been tested?
This change only affects PHP unit tests, and modifies some of the fixtures that inadvertently have data stripped, due to using HTML that KSES doesn't allow.
Checklist:
*.native.js
files for terms that need renaming or removal).