lilei 3 anni fa
parent
commit
749aee51cd
1 ha cambiato i file con 5 aggiunte e 0 eliminazioni
  1. 5 0
      public/menus.js

+ 5 - 0
public/menus.js

@@ -91,6 +91,11 @@ function getContextMenu(){
   
       if (selectStr) { // 如果有选中内容
         flag = true
+        selectStr = selectStr.replace(/\r\n\t\f\v/g,"")
+        selectStr = selectStr.replace(/\n/g,"")
+        selectStr = selectStr.replace(/\t/g,"")
+        selectStr = selectStr.replace(/\f/g,"")
+        selectStr = selectStr.replace(/\v/g,"")
         // 在 选中的元素或者输入框 上面点右键,这样在选中后点别处就不会出现右键复制菜单
         if (text.indexOf(selectStr) !== -1 || value.indexOf(selectStr) !== -1) menu.append(new MenuItem({ label: '复制', click: copyString }))
       }