mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 10:00:13 +01:00
This commit is contained in:
parent
44b8e0bd80
commit
3264cf8ed4
1 changed files with 11 additions and 1 deletions
|
|
@ -60,7 +60,7 @@ export const exportImage = (id: string) => {
|
|||
btnsElement[0].addEventListener("click", () => {
|
||||
exportDialog.destroy();
|
||||
});
|
||||
btnsElement[1].addEventListener("click", () => {
|
||||
btnsElement[1].addEventListener("click", async () => {
|
||||
const msgId = showMessage(window.siyuan.languages.exporting, 0);
|
||||
const containerElement = exportDialog.element.querySelector(".b3-dialog__container") as HTMLElement;
|
||||
containerElement.style.height = "";
|
||||
|
|
@ -70,6 +70,16 @@ export const exportImage = (id: string) => {
|
|||
const contentElement = exportDialog.element.querySelector(".b3-dialog__content") as HTMLElement;
|
||||
contentElement.style.overflow = "hidden";
|
||||
setStorageVal(Constants.LOCAL_EXPORTIMG, window.siyuan.storage[Constants.LOCAL_EXPORTIMG]);
|
||||
const plantumlElements = previewElement.querySelectorAll("[data-subtype='plantuml']");
|
||||
for (let i = 0; i < plantumlElements.length; i++) {
|
||||
const objectElement = plantumlElements[i].querySelector("object");
|
||||
if (objectElement) {
|
||||
const res = await fetch(objectElement.getAttribute("data"));
|
||||
const response = await res.text();
|
||||
objectElement.insertAdjacentHTML("beforebegin", response as string);
|
||||
objectElement.remove();
|
||||
}
|
||||
}
|
||||
setTimeout(() => {
|
||||
addScript("/stage/protyle/js/html-to-image.min.js?v=1.11.13", "protyleHtml2image").then(async () => {
|
||||
let blob = await window.htmlToImage.toBlob(exportDialog.element.querySelector(".b3-dialog__content"));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue