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

Comments

Projects
2 participants
@westonruter
Copy link
Member

westonruter commented Mar 20, 2018

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/

@postphotos postphotos added this to Definition in v1.0 Mar 22, 2018

@amedina amedina self-assigned this Apr 2, 2018

amedina added a commit that referenced this issue Apr 3, 2018

amedina added a commit that referenced this issue Apr 3, 2018

amedina added a commit that referenced this issue Apr 3, 2018

@westonruter westonruter added this to the v0.7 milestone Apr 3, 2018

@westonruter westonruter removed this from Definition in v1.0 Apr 3, 2018

@westonruter westonruter added this to Ready for Review in v0.7 Apr 3, 2018

@westonruter westonruter moved this from Ready for Review to QA in v0.7 Apr 3, 2018

@westonruter westonruter closed this Apr 3, 2018

@MackenzieHartung MackenzieHartung moved this from QA to Ready for Merging in v0.7 Apr 18, 2018

@kevincoleman kevincoleman moved this from Ready for Merging to Production Release in v0.7 May 8, 2018

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