Merge pull request #2739 from dpalou/MOBILE-3704

MOBILE-3704 mod: Fix files with parameters in book & page
main
Pau Ferrer Ocaña 2021-05-03 12:25:01 +02:00 committed by GitHub
commit 8c0a468d85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 2 deletions

View File

@ -971,7 +971,9 @@ export class CoreDomUtilsProvider {
const media = Array.from(element.querySelectorAll('img, video, audio, source, track')); const media = Array.from(element.querySelectorAll('img, video, audio, source, track'));
media.forEach((media: HTMLElement) => { media.forEach((media: HTMLElement) => {
const currentSrc = media.getAttribute('src'); 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') { if (typeof newSrc != 'undefined') {
media.setAttribute('src', newSrc); media.setAttribute('src', newSrc);
@ -991,7 +993,9 @@ export class CoreDomUtilsProvider {
const anchors = Array.from(element.querySelectorAll('a')); const anchors = Array.from(element.querySelectorAll('a'));
anchors.forEach((anchor: HTMLElement) => { anchors.forEach((anchor: HTMLElement) => {
const currentHref = anchor.getAttribute('href'); 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') { if (typeof newHref != 'undefined') {
anchor.setAttribute('href', newHref); anchor.setAttribute('href', newHref);

View File

@ -514,3 +514,15 @@ ion-back-button.md::part(text) {
cursor: auto; cursor: auto;
} }
} }
.core-media-adapt-width {
max-width: 100%;
}
img.core-media-adapt-width {
height: auto;
}
audio.core-media-adapt-width {
width: 100%;
}