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

Resolve <picture> tags #3

Open
petrsvihlik opened this issue May 31, 2017 · 2 comments
Open

Resolve <picture> tags #3

petrsvihlik opened this issue May 31, 2017 · 2 comments
Labels
bug groomed The issue has been groomed and should be in a good shape. hacktoberfest help wanted up-for-grabs

Comments

@petrsvihlik
Copy link
Contributor

petrsvihlik commented May 31, 2017

It's common that Kentico generates picture tags with several sources. The following syntax (which can be found on the Dancing Goat sample site) is not a valid AMP:

<picture>
    <source media="(max-width: 767px)" srcset="/Kentico10webapp/getattachment/4aeae1fa-1cbe-4d28-9523-fc9b754ed379/teaser.aspx?variant=large"></source>
    <source media="(min-width: 768px) and (max-width: 1111px)" srcset="/Kentico10webapp/getattachment/4aeae1fa-1cbe-4d28-9523-fc9b754ed379/teaser.aspx?variant=small"></source>
    <source media="(min-width: 1112px)" srcset="/Kentico10webapp/getattachment/4aeae1fa-1cbe-4d28-9523-fc9b754ed379/teaser.aspx?variant=medium"></source>
    <amp-img class="article-tile-image" src="/Kentico10webapp/getattachment/4aeae1fa-1cbe-4d28-9523-fc9b754ed379/teaser.aspx" alt="Article Coffee processing techniques"></amp-img>
</picture>

The validator says:

The tag 'picture' is disallowed.

The markup should resolve into one of the defined sources. Ideally, to the one with the lowest resolution.

A new replacement logic will have to be added to [TransformToAmpHtml()](

private string TransformToAmpHtml(string finalHtml)
.

@ssiddhantsharma

This comment has been minimized.

@petrsvihlik

This comment has been minimized.

@petrsvihlik petrsvihlik added hacktoberfest groomed The issue has been groomed and should be in a good shape. labels Sep 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug groomed The issue has been groomed and should be in a good shape. hacktoberfest help wanted up-for-grabs
Projects
None yet
Development

No branches or pull requests

2 participants