diff --git a/plugins/aem-assets-plugin/README.md b/plugins/aem-assets-plugin/README.md index 1d469d3945..56156297e2 100644 --- a/plugins/aem-assets-plugin/README.md +++ b/plugins/aem-assets-plugin/README.md @@ -12,7 +12,8 @@ The AEM Assets Plugin helps you quickly integrate with AEM Assets for your AEM p - You need to have access to [Dynamic Media Open API](https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/assets/dynamicmedia/dynamic-media-open-apis/dynamic-media-open-apis-overview) And you need to have pre-configured: -- [AEM Assets Sidekick plugin](https://www.aem.live/docs/aem-assets-sidekick-plugin) +- [AEM Assets Sidekick plugin](https://www.aem.live/docs/aem-assets-sidekick-plugin) if using Doc based authoring OR +- [Universal Editor Custom Asset Picker](https://developer.adobe.com/uix/docs/extension-manager/extension-developed-by-adobe/configurable-asset-picker/) if using Universal Editor based authoring ## Installation @@ -45,7 +46,7 @@ Here's typically how `scripts/aem-assets-plugin-support.js` would look: ``` // The based path of the aem-assets-plugin code. -const codeBasePath = '/plugins/aem-assets-plugin'; +const codeBasePath = `${window.hlx?.codeBasePath}/plugins/aem-assets-plugin`; // The blocks that are to be used from the aem-assets-plugin. const blocks = ['video']; diff --git a/plugins/aem-assets-plugin/scripts/aem-assets.js b/plugins/aem-assets-plugin/scripts/aem-assets.js index 4cdd879300..d97bae0a89 100644 --- a/plugins/aem-assets-plugin/scripts/aem-assets.js +++ b/plugins/aem-assets-plugin/scripts/aem-assets.js @@ -34,14 +34,8 @@ function isExternalImage(element, externalImageMarker) { return true; } - // if the element is an anchor with the href as text content and the href has - // an image extension, it's an external image - if (element.textContent.trim() === element.getAttribute('href')) { - const ext = getUrlExtension(element.getAttribute('href')); - return ext && ['jpg', 'jpeg', 'png', 'gif', 'webp'].includes(ext.toLowerCase()); - } - - return false; + const ext = getUrlExtension(element.getAttribute('href')); + return ext && ['jpg', 'jpeg', 'png', 'gif', 'webp'].includes(ext.toLowerCase()); } /*