Skip to content

AMP Validator considers a reference to template script[type=text/plain] an error #26676

@grapheon

Description

@grapheon

What's the issue?

When referenced from <amp-list ... template="my-template"></amp-list> to <script id="my-template" type="text/plain" template="amp-mustache"> ... </template> AMP Validator showing error "Attribute 'template' in tag 'amp-list' contains a value that does not match any other tags on the page".

However, everything will work, but the page will be deleted from Google AMP Cache due to this error.

How do we reproduce the issue?

  1. Add code to AMP page:
<amp-state id="items"><script type="application/json">[]</script></amp-state>
<button on="tap:AMP.setState({ items: items.splice(items.length, 0, items.length) })">Add item</button>
<template id="items-template" type="amp-mustache"><code>{{#.}}, {{/.}}{{.}}</code></template>
<script id="items-scripted" type="text/plain" template="amp-mustache"><code>{{#.}}, {{/.}}{{.}}</code></script>
<amp-list [src]="items" items="." layout="fixed-height" height="32" template="items-template"></amp-list>
<amp-list [src]="items" items="." layout="fixed-height" height="32" template="items-scripted"></amp-list>
  1. View the AMP page.
  2. See AMP Validator errors.

AMP Validator will point to a line with amp-list referring to the template script[type=text/plain] by id items-scripted. However, everything will work.

Source and Screenshots

Source test script: amp-mustache.html.zip

amp-mustache

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions