X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=docs%2Fsrc%2FRoo_htmleditor_FilterWord.js.html;h=72e1211cdd1e6e12eda6d6ed39323a61982101f5;hb=3c34d062a8d246a6c80c1e8146dfcea3e35e7a5e;hp=72c79251e8d9de900c7c59d4166fd4c7387b5fe9;hpb=7c2fea90177f939535f56046865898918f00c251;p=roojs1
diff --git a/docs/src/Roo_htmleditor_FilterWord.js.html b/docs/src/Roo_htmleditor_FilterWord.js.html
index 72c79251e8..72e1211cdd 100644
--- a/docs/src/Roo_htmleditor_FilterWord.js.html
+++ b/docs/src/Roo_htmleditor_FilterWord.js.html
@@ -14,6 +14,7 @@
this.replaceDocBullets(cfg.node);
+ this.replaceAname(cfg.node);
replaceAname : function (doc)
+ {
+ var aa = Array.from(doc.getElementsByTagName('a'));
+ for (var i = 0; i < aa.length; i++) {
+ var a = aa[i];
+ if (a.hasAttribute("name")) {
+ a.removeAttribute("name");
+ }
+ if (a.hasAttribute("href")) {
+ continue;
+ }
+ this.removeNodeKeepChildren(a);
+
+ }
+
+
+
+ },
+
+
+
replaceDocBullets : function(doc)
{
var listpara = doc.getElementsByClassName('ql-indent-1');
+ var listpara = doc.getElementsByClassName('MsoListParagraphCxSpFirst');
+ for( var i = 0; i < listpara.length; i ++) {
+ listpara.item(i).className = "MsoListParagraph";
+ }
+ var htwo = doc.getElementsByTagName('h2');
+ for( var i = 0; i < htwo.length; i ++) {
+ if (htwo.item(i).hasAttribute('style') && htwo.item(i).getAttribute('style').match(/mso-list:/)) {
+ htwo.item(i).className = "MsoListParagraph";
+ }
+ }
+ listpara = doc.getElementsByClassName('MsoNormal');
+ while(listpara.length) {
+ if (listpara.item(0).hasAttribute('style') && listpara.item(0).getAttribute('style').match(/mso-list:/)) {
+ listpara.item(0).className = "MsoListParagraph";
+ } else {
+ listpara.item(0).className = "MsoNormalx";
+ }
+ }
+ listpara = doc.getElementsByClassName('ql-indent-1');
while(listpara.length) {
this.replaceDocBullet(listpara.item(0));
}
-
- var listpara = doc.getElementsByClassName('MsoListParagraph');
+ listpara = doc.getElementsByClassName('MsoListParagraph');
while(listpara.length) {
+
this.replaceDocBullet(listpara.item(0));
}
+
},
+
+
replaceDocBullet : function(p)
{
if (!ns.className.match(/(MsoListParagraph|ql-indent-1)/i)) {
break;
}
+ if (ns.hasAttribute('style') && 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;
+ }
+ var has_list = false;
+ for(var i = 0; i < spans.length; i++) {
+ if (spans[i].hasAttribute('style') && spans[i].getAttribute('style').match(/mso-list/)) {
+ has_list = true;
+ break;
+ }
+ }
+ if (!has_list) {
+ break;
+ }
items.push(ns);
ns = ns.nextSibling;
- }
+ }
+ if (!items.length) {
+ ns.className = "";
+ return;
+ }
+
var ul = parent.ownerDocument.createElement('ul'); parent.insertBefore(ul, p);
var lvl = 0;
var stack = [ ul ];
var last_li = false;
+ var margin_to_depth = {};
+ max_margins = -1;
+
items.forEach(function(n, ipos) {
parent.removeChild(n);
+
+
return; }
@@ -212,17 +289,26 @@
style = this.styleToObject(n); if (typeof(style['mso-list']) == 'undefined') {
parent.removeChild(n);
+
return;
}
- var nlvl = (style['mso-list'].split(' ')[1].replace(/level/,'') *1) - 1 ;
-
-
+ var margin = style['margin-left'];
+ if (typeof(margin_to_depth[margin]) == 'undefined') {
+ max_margins++;
+ margin_to_depth[margin] = max_margins;
+ }
+ nlvl = margin_to_depth[margin] ;
if (nlvl > lvl) {
var nul = doc.createElement('ul'); if (!last_li) {
+ last_li = doc.createElement('li');
+ stack[lvl].appendChild(last_li);
+ }
last_li.appendChild(nul);
stack[nlvl] = nul;
@@ -235,15 +321,10 @@
parent.removeChild(n);
- },this);
+
+ },this);