X-Git-Url: http://git.roojs.org/?p=roojs1;a=blobdiff_plain;f=Roo%2Fhtmleditor%2FFilterWord.js;fp=Roo%2Fhtmleditor%2FFilterWord.js;h=d2679209f60084f6dcd86450be0f5db36e49b26b;hp=3cb8df628a04c12a030847bab80fde61308f280c;hb=6942f12be128bd0efe5727aae3a554f94a20ecd0;hpb=bb4f20285cb0ce281099e1db5cb76e60175de50f diff --git a/Roo/htmleditor/FilterWord.js b/Roo/htmleditor/FilterWord.js index 3cb8df628a..d2679209f6 100644 --- a/Roo/htmleditor/FilterWord.js +++ b/Roo/htmleditor/FilterWord.js @@ -179,6 +179,8 @@ Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter, var lvl = 0; var stack = [ ul ]; var last_li = false; + var base_lvl = 0; + items.forEach(function(n) { //Roo.log("got innertHMLT=" + n.innerHTML); @@ -212,11 +214,20 @@ Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter, } var nlvl = (style['mso-list'].split(' ')[1].replace(/level/,'') *1) - 1; - if (nlvl > lvl && last_li) { + + + + if (nlvl > lvl) { //new indent - var nul = doc.createElement('ul'); // what about number lists... - last_li.appendChild(nul); - stack[nlvl] = nul; + if (last_li) { + var nul = doc.createElement('ul'); // what about number lists... + last_li.appendChild(nul); + stack[nlvl] = nul; + } else { + // occurs when we get a level (1) but no parent - just put all the children on the top most.. + stack[nlvl] = stack[stack.length-1]; + } + } lvl = nlvl;