Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:bug: fix https://github.com/siyuan-note/siyuan/issues/5702

Vanessab3150e2ce7b4
diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.ts
index afdda55b69..34d1e27bb6 100644
--- a/app/src/menus/protyle.ts
+++ b/app/src/menus/protyle.ts
@@ -255,15 +255,15 @@ export const contentMenu = (protyle: IProtyle, nodeElement: Element) => {
label: window.siyuan.languages.copyPlainText,
click() {
focusByRange(getEditorRange(nodeElement));
- writeText(range.toString());
+ writeText(getSelection().getRangeAt(0).toString());
}
}).element);
window.siyuan.menus.menu.append(new MenuItem({
- label: window.siyuan.languages.copy +" HTML",
+ label: window.siyuan.languages.copy + " HTML",
click() {
focusByRange(getEditorRange(nodeElement));
let html = "";
- range.cloneContents().childNodes.forEach(item => {
+ getSelection().getRangeAt(0).cloneContents().childNodes.forEach(item => {
if (item.nodeType === 3) {
html += item.textContent;
} else {