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: Improve heading block copying on Android and HarmonyOS https://github.com/siyuan-note/siyuan/issues/16946
Daniel3eacf3008be8
diff --git a/app/src/protyle/gutter/index.ts b/app/src/protyle/gutter/index.tsindex d2913ae291..06a976b244 100644--- a/app/src/protyle/gutter/index.ts+++ b/app/src/protyle/gutter/index.ts@@ -1834,9 +1834,9 @@ export class Gutter {removeFoldAttr: nodeElement.getAttribute("fold") !== "1"}, (response) => {if (isInAndroid()) {- window.JSAndroid.writeHTMLClipboard(protyle.lute.BlockDOM2StdMd(response.data).trimEnd(), response.data + Constants.ZWSP);+ window.JSAndroid.writeSiYuanHTMLClipboard(protyle.lute.BlockDOM2StdMd(response.data).trimEnd(), protyle.lute.BlockDOM2HTML(response.data).trimEnd(), response.data + Constants.ZWSP);} else if (isInHarmony()) {- window.JSHarmony.writeHTMLClipboard(protyle.lute.BlockDOM2StdMd(response.data).trimEnd(), response.data + Constants.ZWSP);+ window.JSHarmony.writeSiYuanHTMLClipboard(protyle.lute.BlockDOM2StdMd(response.data).trimEnd(), protyle.lute.BlockDOM2HTML(response.data).trimEnd(), response.data + Constants.ZWSP);} else {writeText(response.data + Constants.ZWSP);}diff --git a/app/src/protyle/util/compatibility.ts b/app/src/protyle/util/compatibility.tsindex 3d28464303..6cdf8ec779 100644--- a/app/src/protyle/util/compatibility.ts+++ b/app/src/protyle/util/compatibility.ts@@ -157,6 +157,9 @@ export const readClipboard = async () => {const textObj = getTextSiyuanFromTextHTML(text.textHTML);text.textHTML = textObj.textHtml;text.siyuanHTML = textObj.textSiyuan;+ if (!text.siyuanHTML) {+ text.siyuanHTML = window.JSAndroid.readSiYuanHTMLClipboard();+ }return text;}if (isInHarmony()) {@@ -165,6 +168,9 @@ export const readClipboard = async () => {const textObj = getTextSiyuanFromTextHTML(text.textHTML);text.textHTML = textObj.textHtml;text.siyuanHTML = textObj.textSiyuan;+ if (!text.siyuanHTML) {+ text.siyuanHTML = window.JSHarmony.readSiYuanHTMLClipboard();+ }return text;}if (typeof navigator.clipboard === "undefined") {diff --git a/app/src/types/index.d.ts b/app/src/types/index.d.tsindex c78506fe91..291d1d552a 100644--- a/app/src/types/index.d.ts+++ b/app/src/types/index.d.ts@@ -243,9 +243,11 @@ interface Window {changeStatusBarColor(color: string, mode: number): voidwriteClipboard(text: string): voidwriteHTMLClipboard(text: string, html: string): void+ writeSiYuanHTMLClipboard(text: string, html: string, siyuanHTML: string): voidwriteImageClipboard(uri: string): voidreadClipboard(): stringreadHTMLClipboard(): string+ readSiYuanHTMLClipboard(): stringgetBlockURL(): stringhideKeyboard(): voidshowKeyboard(): void@@ -261,8 +263,10 @@ interface Window {changeStatusBarColor(color: string, mode: number): voidwriteClipboard(text: string): voidwriteHTMLClipboard(text: string, html: string): void+ writeSiYuanHTMLClipboard(text: string, html: string, siyuanHTML: string): voidreadClipboard(): stringreadHTMLClipboard(): string+ readSiYuanHTMLClipboard(): stringreturnDesktop(): voidprint(title: string, html: string): voidgetScreenWidthPx(): number