From 7507e9306847e6b9c688e4be6611b721fc7e969b Mon Sep 17 00:00:00 2001 From: Albert Gasset Date: Mon, 29 Jul 2019 10:16:10 +0200 Subject: [PATCH] MOBILE-3074 format-text: No magnifying glasses for images inside links --- src/directives/format-text.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/directives/format-text.ts b/src/directives/format-text.ts index 7cba685c7..2f851c361 100644 --- a/src/directives/format-text.ts +++ b/src/directives/format-text.ts @@ -168,6 +168,11 @@ export class CoreFormatTextDirective implements OnChanges { const elWidth = this.getElementWidth(this.element) || window.innerWidth; imgs.forEach((img: HTMLImageElement) => { + // Skip image if it's inside a link. + if (img.closest('a')) { + return; + } + let imgWidth = parseInt(img.getAttribute('width')); if (!imgWidth) { // No width attribute, use real size.