Explorar el Código

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

Vanessa hace 2 años
padre
commit
b3150e2ce7
Se han modificado 1 ficheros con 3 adiciones y 3 borrados
  1. 3 3
      app/src/menus/protyle.ts

+ 3 - 3
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 {