-
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
Validator reports valid script types as invalid #4392
Comments
These script types are allowed only when they are used on the context of other AMP components. You can't add an So this is working as expected. In v1.5 the error message will be improved to explain why it is invalid. |
Thanks for clarifying @westonruter! I should have tested this with https://validator.amp.dev first, which fails with the same types as well. Am I interpreting the spec incorrectly or do you think this could be clarified better since it doesn't mention that some types are only valid in a particular context? |
What you have screenshotted are the docs, not the formal spec. (The docs could be made more clear here.) To see what the formal spec requires, you should look at the underlying protoascii. For example, here is a definition for an Notice this key line:
You can see that same by looking at https://github.com/ampproject/amp-wp/blob/develop/includes/sanitizers/class-amp-allowed-tags-generated.php For every instance of |
Bug Description
When validating a URL, the validator reports that script types are invalid, in contrast to the valid types defined in the docs for AMP HTML.
According to the AMP HTML Specification,
<script>
tags are allowed with the followingtype
attributes:application/ld+json
application/json
text/plain
Of these, only
application/ld+json
is not flagged as invalid by the validator.Expected Behaviour
All valid script types outlined by the AMP HTML Spec should not be marked invalid and removed by the AMP Validator.
Steps to reproduce
script
tag on the page with either type ofapplication/json
ortext/plain
Additional context
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation brief
QA testing instructions
Demo
Changelog entry
The text was updated successfully, but these errors were encountered: