diff --git a/packages/clipper/src/domtoimage.ts b/packages/clipper/src/domtoimage.ts index bd41553ac..43d94d03c 100644 --- a/packages/clipper/src/domtoimage.ts +++ b/packages/clipper/src/domtoimage.ts @@ -36,7 +36,8 @@ const defaultOptions: Options = { }; async function getInlinedNode(node: HTMLElement, options: Options) { - const { fonts, stylesheets, inlineImages } = options.inlineOptions || {}; + const { fonts, images, stylesheets, inlineImages } = + options.inlineOptions || {}; if (stylesheets) await inlineStylesheets(options.fetchOptions); @@ -44,6 +45,11 @@ async function getInlinedNode(node: HTMLElement, options: Options) { if (!clone || clone instanceof Text) return; + if (!images) { + const images = clone.querySelectorAll("img"); + images.forEach((image) => image.remove()); + } + if (fonts) clone = await embedFonts(clone, options.fetchOptions); if (inlineImages) await inlineAllImages(clone, options.fetchOptions);