adobe / aem-boilerplate

Use this repository template for new AEM projects.
https://main--aem-boilerplate--adobe.hlx.page
Apache License 2.0
111 stars 284 forks source link

fix: cards fail if the text contains an icon #354

Open Buuhuu opened 2 months ago

Buuhuu commented 2 months ago

Since icons :icon-name: are rendered as <span class="icon icon-icon-name"></span> and decorated with <span class="icon icon-icon-name"><img ...></span> now, querying all <img> in the list of cards and assuming they all have a closest <picture> is wrong. It will fail for the icon <img> and the cards block will be broken.

With this change I limit the selector to <img> that actually have a <picture> parent.

Test URLs:

aem-code-sync[bot] commented 2 months ago
Page Scores Audits Google
/ PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI