mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
clipper: append head for node selection clips
Signed-off-by: 01zulfi <85733202+01zulfi@users.noreply.github.com>
This commit is contained in:
@@ -199,7 +199,11 @@ function enterNodeSelectionMode(doc: Document, config?: Config) {
|
|||||||
`.${CLASSES.nodeSelected}`
|
`.${CLASSES.nodeSelected}`
|
||||||
);
|
);
|
||||||
|
|
||||||
const div = document.createElement("div");
|
const { head } = await getPage(document, config, false);
|
||||||
|
const html = document.createElement("html");
|
||||||
|
html.append(head!);
|
||||||
|
const body = document.createElement("body");
|
||||||
|
html.append(body);
|
||||||
for (const node of selectedNodes) {
|
for (const node of selectedNodes) {
|
||||||
node.classList.remove(CLASSES.nodeSelected);
|
node.classList.remove(CLASSES.nodeSelected);
|
||||||
const inlined = await getInlinedNode(node as HTMLElement, {
|
const inlined = await getInlinedNode(node as HTMLElement, {
|
||||||
@@ -212,9 +216,9 @@ function enterNodeSelectionMode(doc: Document, config?: Config) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (!inlined) continue;
|
if (!inlined) continue;
|
||||||
div.appendChild(inlined);
|
body.appendChild(inlined);
|
||||||
}
|
}
|
||||||
resolve(div?.outerHTML);
|
resolve(html?.outerHTML);
|
||||||
},
|
},
|
||||||
() => reject("Cancelled.")
|
() => reject("Cancelled.")
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user