diff --git a/src/core/services/utils/dom.ts b/src/core/services/utils/dom.ts index 34c897a7d..cffd289dc 100644 --- a/src/core/services/utils/dom.ts +++ b/src/core/services/utils/dom.ts @@ -971,7 +971,9 @@ export class CoreDomUtilsProvider { const media = Array.from(element.querySelectorAll('img, video, audio, source, track')); media.forEach((media: HTMLElement) => { const currentSrc = media.getAttribute('src'); - const newSrc = currentSrc ? paths[CoreTextUtils.decodeURIComponent(currentSrc)] : undefined; + const newSrc = currentSrc ? + paths[CoreUrlUtils.removeUrlParams(CoreTextUtils.decodeURIComponent(currentSrc))] : + undefined; if (typeof newSrc != 'undefined') { media.setAttribute('src', newSrc); @@ -991,7 +993,9 @@ export class CoreDomUtilsProvider { const anchors = Array.from(element.querySelectorAll('a')); anchors.forEach((anchor: HTMLElement) => { const currentHref = anchor.getAttribute('href'); - const newHref = currentHref ? paths[CoreTextUtils.decodeURIComponent(currentHref)] : undefined; + const newHref = currentHref ? + paths[CoreUrlUtils.removeUrlParams(CoreTextUtils.decodeURIComponent(currentHref))] : + undefined; if (typeof newHref != 'undefined') { anchor.setAttribute('href', newHref); diff --git a/src/theme/theme.base.scss b/src/theme/theme.base.scss index 8ab2de7ad..65735f44e 100644 --- a/src/theme/theme.base.scss +++ b/src/theme/theme.base.scss @@ -514,3 +514,15 @@ ion-back-button.md::part(text) { cursor: auto; } } + +.core-media-adapt-width { + max-width: 100%; +} + +img.core-media-adapt-width { + height: auto; +} + +audio.core-media-adapt-width { + width: 100%; +}