amp-prototyper icon indicating copy to clipboard operation
amp-prototyper copied to clipboard

Unable to convert AMP page to AMP

Open jonchenn opened this issue 5 years ago • 2 comments

When a page is already converted to AMP, e.s. with AMP-related tags after rendering, the AMP validation will throw many errors.

AMP error examples:

line 2, col 0: The attribute 'amp-version' may not appear in tag 'html'. (see https://amp.dev/documentation/guides-and-tutorials/learn/spec/amphtml#required-markup) line 15, col 2: The text inside tag 'style amp-custom' contains 'CSS i-amphtml- name prefix', which is disallowed. (see https://amp.dev/documentation/guides-and-tutorials/learn/spec/amphtml#stylesheets)

jonchenn avatar Jun 23 '19 23:06 jonchenn

What if you pull the source instead of the content if it's detected that it's an AMP page? Not sure if you can pull that with puppeteer, but I think it'll be doable.

rjaponte avatar Jul 10 '19 18:07 rjaponte

that's possible. But the question is: should we support this feature? Or just throw out an error/warning that says "This page is already an AMP"?

jonchenn avatar Jul 12 '19 19:07 jonchenn