Changed Roo/htmleditor/FilterWord.js
authorAlan <alan@roojs.com>
Wed, 29 Jun 2022 02:27:12 +0000 (10:27 +0800)
committerAlan <alan@roojs.com>
Wed, 29 Jun 2022 02:27:12 +0000 (10:27 +0800)
Roo/htmleditor/FilterWord.js

index d3d6cc4..aef2989 100644 (file)
@@ -144,7 +144,7 @@ Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter,
     replaceDocBullets : function(doc)
     {
         // this is a bit odd - but it appears some indents use ql-indent-1
-         //Roo.log(doc.innerHTML);
+        Roo.log(doc.innerHTML);
         
         var listpara = doc.getElementsByClassName('MsoListParagraphCxSpFirst');
         for( var i = 0; i < listpara.length; i ++) {
@@ -157,7 +157,12 @@ Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter,
                 htwo.item(i).className = "MsoListParagraph";
             }
         }
-        
+        listpara = doc.getElementsByClassName('MsoNormal');
+        for( var i = 0; i < listpara.length; i ++) {
+            if (listpara.item(i).getAttribute('style').match(/mso-list:/)) {
+                listpara.item(i).className = "MsoListParagraph";
+            }
+        }
         listpara = doc.getElementsByClassName('ql-indent-1');
         while(listpara.length) {
             this.replaceDocBullet(listpara.item(0));
@@ -189,6 +194,12 @@ Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter,
             if (!ns.className.match(/(MsoListParagraph|ql-indent-1)/i)) {
                 break;
             }
+            if (ns.getAttribute('style').match(/mso-list/)) {
+                items.push(ns);
+                ns = ns.nextSibling;
+                has_list = true;
+                continue;
+            }
             var spans = ns.getElementsByTagName('span');
             if (!spans.length) {
                 break;
@@ -203,10 +214,10 @@ Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter,
             if (!has_list) {
                 break;
             }
+            items.push(ns);
+              ns = ns.nextSibling;
             
             
-            items.push(ns);
-            ns = ns.nextSibling;
         }
         if (!items.length) {
             ns.className = "";