Oh thanks for pointing that out! We’ll fix in 1.5.3 today.
Thanks for opening this! Your videos are great, especially on agile.
I’m working on this.
Background
This definitely looks to be an issue.
When adding this to a Custom HTML block:
<amp-list
width="auto"
height="100"
layout="fixed-height"
src="/static/inline-examples/data/amp-list-urls.json"
>
<template type="amp-mustache">
<amp-img src=”{{src}}” srcset=”{{srcset}}” width=”{{width}}” height=”{{height}}” layout=”responsive” alt=”Episode Thumbnail Image for {{title}}”></amp-img>
</template>
</amp-list>
…theres a validation error ‘Invalid value ”{{width}}” for attribute width.’
There are also validation errors for the attributes for
and image
when I removed the width
and height
attributes:
<amp-list
width="auto"
height="100"
layout="fixed-height"
src="/static/inline-examples/data/amp-list-urls.json"
>
<template type="amp-mustache">
<amp-img src=”{{src}}” srcset=”{{srcset}}” alt=”Episode Thumbnail Image for {{title}}”></amp-img>
</template>
</amp-list>
Thanks you two!
This plugin is fantastic btw. I’m developing a custom theme locally to launch a new version of my site and so far it’s been a great experience.
Thanks again for the support.
Jayme
Nice, thanks so much for using this plugin. Good to hear you’re writing a custom theme with this.
This also looks to be an issue when the <template>
is not wrapped in <amp-list>
. 1.4.4
is the latest version where I didn’t see this issue.
I’m not sure if this helps or not, but here’s the full hierarchy of content I have starting from amp-list:
<amp-list class="amp-2col-list" width="auto" height="530" layout="fixed-height" load-more="auto" src="<?php echo site_url('/wp-json/jesite/v1/hsd-episodes?page=1') ?>">
<div placeholder>Loading ...</div>
<div fallback>Failed to load Healthy Software Developer Episodes.</div>
<template type="amp-mustache">
<div class="list-item post">
<a href="{{url}}">
etc...
The issue is likely a regression introduced by the new AMP_Layout_Sanitizer
in 1.5. The same exemption used in the AMP_Tag_And_Attribute_Sanitizer
to skip validating attributes containing {{.+}}
inside of template
tags needs to be done by the layout sanitizer.
Hi @jcedwards76,
Hope you’re having a good day.
If you have a chance, could you please test this build of the plugin with a fix for this issue?
https://github.com/ampproject/amp-wp/pull/4583#issuecomment-614162529
Thanks, Jayme!
@ryankienstra I just tested this. Yep, it works now. The page passes when re-validated and renders properly.
Excellent. This will be included in the next release. Thank you for testing.
We’d appreciate a plugin review! https://wordpress.org/support/plugin/amp/reviews/#new-post