Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will the SVG part in Accelerated Mobile Pages (AMP) support the IMG tag?

Tags:

html

amp-html

I used the following SVG code in my AMP site and it is not working:

<image style="overflow:visible;" width="324" height="180" 
     xlink:href="data:image/jpeg;base64, /9j/4AAQSkZ....">
--html</image>

I need AMP to use SVG files in a bigger project I am working on:

http://flexedd-amp-2.azurewebsites.net/IssuesContent/WRI/Mitigation_Goal_Executive_Summary/pages/4-09-v/Page-1-4-09-V.svg

At the moment I have to use the SVG files as SVG images in a AMP-HTML document like this example: http://www.flexedd.com/#amp

like image 719
Peter Löbel Avatar asked Dec 15 '15 12:12

Peter Löbel


1 Answers

As you can see from: https://github.com/ampproject/amphtml/issues/496 SVG support is provided by specifically whitelisting attributes. If you take a look at this line from the validator's configuration: https://github.com/ampproject/amphtml/blob/master/validator/validator.protoascii#L912 you'll that see that AMP doesn't currently allow embedding external resources.

If you want the SVG <image> element to be supported then you should join in the discussion on this Github issue: https://github.com/ampproject/amphtml/issues/96 although it's likely that the project would only support images that are being loaded locally.

like image 167
ade Avatar answered Sep 20 '22 03:09

ade