amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

Using amp-twitter causes pages to fail validation

Open ryanlombardo opened this issue 10 years ago • 2 comments

Short description of your issue:

Pages using amp-twitter fail validation because tweets contain img elements instead of amp-img.

How do we reproduce the issue?

Here's an example: http://www.buzzfeed.com/amphtml/lukebailey/lol-puns

In Google Search Console, this post was flagged as failing validation. Using #development=1 also shows a failed validation.

From Search Console...

Unknown Syntax Error: noscript > ... > imgDid you mean amp-img?, src=http://pbs.twimg.com/profile_images/528917036991131648/IPVTzuvb_normal.jpeg, src=http://pbs.twimg.com/media/B3Tpzx3CIAEIPb5.jpg, src=, src=http://pbs.twimg.com/profile_images/525241125184233472/gvhy-V_q_normal.jpeg

What browsers are affected?

All

Which AMP version is affected?

We are not sure when this started breaking. Currently using https://cdn.ampproject.org/v0/amp-twitter-0.1.js

ryanlombardo avatar Mar 25 '16 14:03 ryanlombardo

I tried a couple of things:

  • looking at: https://ampbyexample.com/components/amp-twitter/#development=1
  • cutting and pasting your amp-twitter elements into a sample page on localhost

They all worked and passed validation. I don't believe this is an AMP bug.

Looking at the source of the Buzzfeed page it looks like the CMS is adding the amp-twitter element and extra Twitter-specific markup.

I see the following HTML: https://gist.github.com/adewale/2bd9ea361875b5a5cc00

The figcaption markup is being generated by Buzzfeed's CMS not by AMP.

adewale avatar Mar 25 '16 15:03 adewale

Correct. The document contains <img> unrelated to amp-twitter element.

dvoytenko avatar Mar 25 '16 16:03 dvoytenko