Просмотр исходного кода

Merge branch 'master' of https://github.com/unaio/una

AntonLV 4 лет назад
Родитель
Сommit
f5667185e4
1 измененных файлов с 10 добавлено и 3 удалено
  1. 10 3
      inc/js/editor.quill.js

+ 10 - 3
inc/js/editor.quill.js

@@ -261,9 +261,16 @@ function bx_editor_init(oEditor, oParams){
 
     if (oParams.insert_as_plain_text){
         oEditor.clipboard.addMatcher (Node.ELEMENT_NODE, function (node, delta) {
-            var plaintext = $ (node).text ();
-            const Delta = Quill.import('delta')
-            return new Delta().insert (plaintext);
+			let ops = []
+			delta.ops.forEach(op => {
+				if (op.insert && typeof op.insert === 'string') {
+					ops.push({
+						insert: op.insert
+					})
+				}
+			})
+			delta.ops = ops
+			return delta
         });
     }