An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: https://github.com/siyuan-note/siyuan/issues/12691
Vanessa2f107dda2e7e
diff --git a/app/src/protyle/preview/diagram.ts b/app/src/protyle/preview/diagram.tsindex b7acd50513..749a41738c 100644--- a/app/src/protyle/preview/diagram.ts+++ b/app/src/protyle/preview/diagram.ts@@ -24,10 +24,16 @@ export const getDiagramBlock = (element: HTMLElement) => {*/export const previewDiagram = (diagramElement: HTMLElement) => {addScript(`${Constants.PROTYLE_CDN}/js/html-to-image.min.js?v=1.11.13`, "protyleHtml2image").then(async () => {- const renderElement = diagramElement.querySelector('[contenteditable="false"]') || diagramElement;+ const type = diagramElement.getAttribute("data-subtype");+ let renderElement = diagramElement.querySelector('[contenteditable="false"] svg');+ if (type === "plantuml") {+ renderElement = diagramElement.querySelector("object");+ } else if (type === "echarts") {+ renderElement = diagramElement.querySelector("canvas");+ }let blob: Blob;try {- blob = await window.htmlToImage.toBlob(renderElement);+ blob = await window.htmlToImage.toBlob(renderElement, {backgroundColor: "#fff"});} catch (e) {return;}diff --git a/app/src/types/index.d.ts b/app/src/types/index.d.tsindex 613de5ec2e..0c7f04f8b4 100644--- a/app/src/types/index.d.ts+++ b/app/src/types/index.d.ts@@ -267,8 +267,8 @@ interface Window {}};htmlToImage: {- toCanvas: (element: Element) => Promise<HTMLCanvasElement>- toBlob: (element: Element) => Promise<Blob>+ toCanvas: (element: Element, options?: Partial<IObject>) => Promise<HTMLCanvasElement>+ toBlob: (element: Element, options?: Partial<IObject>) => Promise<Blob>};siyuan: ISiyuan;JSAndroid: {