-
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
Validation errors are not reported for “i-amphtml” appearing in CSS #771
Comments
it's my mistake. i added .i-amphtml in custom css |
@anand-a6 Thank you very much, it solved my problem. with:
|
@anand-a6 Thanks solved my problem. |
This is something that the AMP plugin could actually catch and remove automatically, while reporting a validation error. It hasn't come up frequently, however, so I don't know if it is something that we should explicitly account for. |
Note that the CSS tree shaker will be pre-emptively removing such For example, if someone pasted some HTML copied from an AMP page via DevTools, this could include elements with the Here is some example code to cause the validation error which is not currently being caught by the AMP plugin: add_action(
'wp_footer',
static function () {
?>
<style type="text/css" class="illegal-amphtml-classes">.i-amphtml-layout { outline: solid 1px red; }</style>
<span class="i-amphtml-layout">i-amphtml-layout</span>
<?php
}
); With this plugin code, WordPress is successfully removing the invalid The I was expecting this to get flagged as an error in See the validator spec for
Nevertheless, the generated spec data only includes the second amp-wp/includes/sanitizers/class-amp-allowed-tags-generated.php Lines 15327 to 15333 in 35ca34f
So there is also a bug with |
So validation errors that should be getting raised which aren't at present:
|
Note: If an |
Note: In the same way that the tag-and-attribute-stanizer is allowing Custom CSS that is larger than 75KB (since the style sanitizer is handling it) we should also update the tag-and-attribute sanitizer to allow Otherwise, if the invalid markup (the |
QA Passed. Results here: #5356 (comment) |
The text (CDATA) inside tag 'style amp-custom' contains 'CSS i-amphtml- name prefix', which is disallowed.
The text was updated successfully, but these errors were encountered: