Amphtml: amp-list: amp-mustache removes svg

Created on 17 Mar 2017  路  13Comments  路  Source: ampproject/amphtml

SVG inserted in the template markup are removed on amp-list output.

see: https://jsbin.com/qucolisaja/1/edit?html,output

Blocked Soon Bug

Most helpful comment

Had the same issue. This was confusing and time consuming, can a validation warning be thrown in the meantime? Ideally, anything that gets removed from the template should generate some feedback to the developer.

All 13 comments

/to @choumx

SVG is temporarily blacklisted from amp-mustache which will be resolved with #1156. Marking as "blocked". Sorry about that!

/cc @dvoytenko

Yeah, hard to imagine we can pick up all rules for validation of SVG w/o the actual validator.

amp-img's do not seam to be supported either. I tried both an svg and an amp-img and neither are rendering.

amp-img are used a lot and should work just fine. Do you have an example where amp-img doesn't work?

I tried using an amp-img in amp-mustache and couldn't get it to work. Not sure what the problem is, perhaps an error on my part. Our company decided to just remove the images all together opposed to letting me dedicate time to figuring it out.

@travishoki If you have an example - please send it to us, now or later.

Had the same issue. A work around I used is converting the svg to base64 and assign it as background to my icon class using the good old background: url('data:image/svg+xml;base64, ...'). Not ideal as I need to keep the css below 50kb, but its a workaround for now.

Had the same issue. This was confusing and time consuming, can a validation warning be thrown in the meantime? Ideally, anything that gets removed from the template should generate some feedback to the developer.

Same for me and my team, luckily we stumbled upon this issue or we would've carried on debugging for even longer.

@command3r @sanjsanj Sorry about that! We just added an error for attribute sanitization in #13176 so it should be easy to add another for elements.

@travishoki @dvoytenko - Was unable to pass AMP-IMG or SVG tags through amp-list/amp-mustache, however, you can render AMP-IMG using the standard HTML IMG tag.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mrjoro picture mrjoro  路  3Comments

aghassemi picture aghassemi  路  3Comments

gmajoulet picture gmajoulet  路  3Comments

mkhatib picture mkhatib  路  3Comments

edhollinghurst picture edhollinghurst  路  3Comments