浏览代码

:bug: windows https://github.com/siyuan-note/siyuan/issues/5667

Vanessa 2 年之前
父节点
当前提交
f534be1794
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      app/src/protyle/util/paste.ts

+ 4 - 0
app/src/protyle/util/paste.ts

@@ -107,6 +107,10 @@ export const paste = async (protyle: IProtyle, event: (ClipboardEvent | DragEven
         if (doc.body && doc.body.innerHTML) {
             textHTML = doc.body.innerHTML;
         }
+        // windows 剪切板
+        if (textHTML.startsWith("\n<!--StartFragment-->") && textHTML.endsWith("<!--EndFragment-->\n\n")) {
+            textHTML = doc.body.innerHTML.trim().replace("<!--StartFragment-->", "").replace("<!--EndFragment-->", "");
+        }
     }
 
     textHTML = Lute.Sanitize(textHTML);