mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-02-23 19:49:56 +01:00
clipper: remove images from clip if images false
Signed-off-by: 01zulfi <85733202+01zulfi@users.noreply.github.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user