Skip to content
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

Prevent AMP validation error due to img src containing spaces #1030

Closed
westonruter opened this issue Mar 20, 2018 · 0 comments
Closed

Prevent AMP validation error due to img src containing spaces #1030

westonruter opened this issue Mar 20, 2018 · 0 comments
Assignees
Milestone

Comments

@westonruter
Copy link
Member

If I add an img with spaces as the src like so:

<img src="   " width="100" height="100">

Then this gets output as:

<amp-img src="" width="100" height="100" sizes="(min-width: 100px) 100px, 100vw" class="amp-wp-enforced-sizes"></amp-img>

AMP complains about this:

Missing URL for attribute 'src' in tag 'amp-img'.

If an img is added with an empty src then the amp-img gets removed entirely. That should also be the behavior when src contains just whitespace.

Support topic: https://wordpress.org/support/topic/google-console-detected-amp-error/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants