-
Notifications
You must be signed in to change notification settings - Fork 384
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
Utilize new data-amp-bind-* alternative syntax for amp-bind attributes #1162
Comments
Is this issue solved ? |
No |
We need to update the whitelist sanitizer to automatically enqueue amp-bind when amp-wp/includes/sanitizers/class-amp-tag-and-attribute-sanitizer.php Lines 550 to 558 in efd1d07
This should also be done in the |
We also need to make sure that the alternative syntax is supported in places like: amp-wp/includes/sanitizers/class-amp-style-sanitizer.php Lines 441 to 446 in 437c335
Anywhere that Alternatively, we could just rewrite all bracketed-syntax attributes with |
Glad I found this, we recently found out about the wonderful |
I started work on this. @conwaydev Initial PR ready for testing: #2974 |
Also reported on support forum: https://wordpress.org/support/topic/hambuger-menu-no-opening-on-static-version-of-website/ |
@conwaydev Please test: #2974 |
There is a new XHTML-compatible amp-bind attribute syntax: ampproject/amphtml#11115 via ampproject/amphtml#15408
Instead of:
We can now do:
What this means is that we now have an official way of representing amp-bind attributes in PHP's DOM internals. We can now eliminate
AMP_DOM_Utils::get_amp_bind_placeholder_prefix()
andAMP_DOM_Utils::restore_amp_bind_attributes()
entirely, andAMP_DOM_Utils::convert_amp_bind_attributes()
can be modified to just convert the bracketed syntax into thedata-amp-bind-*
syntax. There would be no need to restore the bracketed syntax when re-serializing. The result will be improved performance.The text was updated successfully, but these errors were encountered: