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.