-
Notifications
You must be signed in to change notification settings - Fork 847
Donations: Avoid using buttons elements in block output #16743
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
Conversation
|
Caution: This PR has changes that must be merged to WordPress.com |
|
Thank you for the great PR description! When this PR is ready for review, please apply the E2E results is available here (for debugging purposes): https://jetpack-e2e-dashboard.herokuapp.com/pr-16743 Scheduled Jetpack release: September 1, 2020. |
|
Fantastic 🎉 Tried it with a variety of tab combinations and currencies, nothing unexpected (I did notice that on the front-end, the custom amount validation works well for USD, but not for other currencies). |
kwight
left a comment
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.
One followup mentioned about front-end validation, but otherwise button extraction works great.
Changes proposed in this Pull Request:
Some sites such as any WP.com simple site might have a more restricted KSES logic that doesn't allow
<button>elements in a post content.To work around that, this PR modifies the output of the Donations block so all
<button>elements are replaced with semantically equivalent<div role="button">elements, which are allowed in WP.com. We still need to allow thedata-*attributes in WP.com KSES, but that will be handled in separate WP.com patch. Thecontenteditableattribute has been also removed from the post content and it's set not dynamically with JS so it doesn't need to be allowed by KSES.It also simplifies the general markup by removing all
wp-block-buttonsandwp-block-buttonclasses, so we need to override less styles.Jetpack product discussion
p1HpG7-9NV-p2
Does this pull request change what data or activity we track or use?
No.
Testing instructions:
Proposed changelog entry for your changes:
N/A.