- π¨π¦Canada joseph.olstad
3 years later and we're still using this for WCAG compliance
Attribute alt not allowed on element div in HTML5. This causes errors in HTML validation. If you provide it to Google Search, AMP pages will not appear in search results.
<div data-embed-button="media_browser"
data-entity-embed-display="media_image"
data-entity-embed-display-settings="small"
data-entity-type="media"
data-entity-uuid="XXXXXXXXXXXX"
alt="myImageAlt" //This causes errors
title="myImageTitle"
data-langcode="ja"
class="embedded-entity align-center">
<amp-img src="/sites/default/files/styles/small/public/images/myImage.jpg?itok=XXXXXXXX"
width="700"
height="510"
alt="myImageAlt"
title="myImageTitle"
layout="responsive">
</amp-img>
</div>
Remove alt attribute from div element that rendered from <drupal-entity> .
<div data-embed-button="media_browser"
data-entity-embed-display="media_image"
data-entity-embed-display-settings="small"
data-entity-type="media"
data-entity-uuid="XXXXXXXXXXXX"
// just removed alt with `attributes.removeAttribute('alt')` in twig.
title="myImageTitle"
data-langcode="ja"
class="embedded-entity align-center">
<amp-img src="/sites/default/files/styles/small/public/images/myImage.jpg?itok=XXXXXXXX"
width="700"
height="510"
alt="myImageAlt"
title="myImageTitle"
layout="responsive">
</amp-img>
</div>
reviews needed
Needs review
1.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
3 years later and we're still using this for WCAG compliance