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

Validator fails for mustache template variables inside template node #2670

Closed
src-code opened this issue Mar 22, 2016 · 10 comments
Closed

Validator fails for mustache template variables inside template node #2670

src-code opened this issue Mar 22, 2016 · 10 comments

Comments

@src-code
Copy link
Contributor

The validator as of v1457721872758 fails when including a mustache template inline, such as in an amp-list. For example, the following markup should be valid:

<script async custom-template="amp-mustache" src="https://cdn.ampproject.org/v0/amp-mustache-0.1.js"></script>
...
<amp-list src="https://www.example.com/amp/feed?RANDOM" width="auto" height="200" layout="fixed-height">
  <template type="amp-mustache">
    <amp-img src="{{image.url}}" width={{image.width}} height={{image.height}}></amp-img>
  </template>
</amp-list>

The validator produces the following error:

The attribute 'width' in tag 'amp-img' is set to the invalid value '{{image.width}}'.

cc @dvoytenko @Gregable

@Gregable
Copy link
Member

I can reproduce. The issue is not new and is specific to the tag layout calculation which handles width/height in a different way that most attributes. src is a non-issue, for example. This is a little tricky because it's impossible to determine if layout is legal in the presence of mustache template variables.

@dvoytenko
Copy link
Contributor

@Gregable I see. In this case, we have to skip this part of validation in template. Perhaps to reduce the negative impact, we can only skip it when width/height/layout and other related values use expressions in them.

@Gregable
Copy link
Member

Agreed.

@rudygalfi rudygalfi added this to the Sprint 2016-03-31 milestone Mar 24, 2016
@rudygalfi
Copy link
Contributor

Is there an open PR for this?

@Gregable
Copy link
Member

Not yet.

@rudygalfi rudygalfi modified the milestones: Sprint: 2016-04-14 [next], Sprint 2016-03-31 [current] Mar 30, 2016
@rudygalfi
Copy link
Contributor

OK, moving to next milestone. Thanks for the update!

@rudygalfi
Copy link
Contributor

@Gregable ping? Should we roll into next sprint or into backlog?

@Gregable
Copy link
Member

This one is 'done', I'm working on releasing it to github as we 'speak'.

@Gregable
Copy link
Member

This will go live to in-browser validation next week most likely.

@Gregable
Copy link
Member

This is live everywhere.

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

5 participants