From feb7d33d1facef983976eecb6e475e11054f80ba Mon Sep 17 00:00:00 2001 From: Alan Date: Thu, 7 Jul 2022 10:02:41 +0800 Subject: [PATCH] fix checking for attribute on word filter --- Roo/htmleditor/FilterWord.js | 4 ++-- roojs-all.js | 6 +++--- roojs-debug.js | 4 ++-- roojs-ui-debug.js | 4 ++-- roojs-ui.js | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Roo/htmleditor/FilterWord.js b/Roo/htmleditor/FilterWord.js index 520e658e0b..6fefb3e23c 100644 --- a/Roo/htmleditor/FilterWord.js +++ b/Roo/htmleditor/FilterWord.js @@ -220,7 +220,7 @@ 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/)) { + if (ns.hasAttribute('style') && ns.getAttribute('style').match(/mso-list/)) { items.push(ns); ns = ns.nextSibling; has_list = true; @@ -232,7 +232,7 @@ Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter, } var has_list = false; for(var i = 0; i < spans.length; i++) { - if (spans[i].getAttribute('style').match(/mso-list/)) { + if (spans[i].hasAttribute('style') && spans[i].getAttribute('style').match(/mso-list/)) { has_list = true; break; } diff --git a/roojs-all.js b/roojs-all.js index 48e99f4990..4681811e9e 100644 --- a/roojs-all.js +++ b/roojs-all.js @@ -1935,9 +1935,9 @@ var C={};Roo.each(B,function(s){if(!s.match(/:/)){return;}var kv=s.split(":");C[ }if(a.hasAttribute("href")){continue;}this.removeNodeKeepChildren(a);}},replaceDocBullets:function(A){var B=A.getElementsByClassName('MsoListParagraphCxSpFirst');for(var i=0;iF){var N=B.createElement('ul'); if(!H){H=B.createElement('li');G[F].appendChild(H);}H.appendChild(N);G[nlvl]=N;}F=nlvl;var O=G[nlvl].appendChild(B.createElement('li'));H=O;O.innerHTML=n.innerHTML;A.removeChild(n);},this);}}); // Roo/htmleditor/FilterStyleToTag.js diff --git a/roojs-debug.js b/roojs-debug.js index 5631a914b4..85f8dfca24 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -46302,7 +46302,7 @@ 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/)) { + if (ns.hasAttribute('style') && ns.getAttribute('style').match(/mso-list/)) { items.push(ns); ns = ns.nextSibling; has_list = true; @@ -46314,7 +46314,7 @@ Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter, } var has_list = false; for(var i = 0; i < spans.length; i++) { - if (spans[i].getAttribute('style').match(/mso-list/)) { + if (spans[i].hasAttribute('style') && spans[i].getAttribute('style').match(/mso-list/)) { has_list = true; break; } diff --git a/roojs-ui-debug.js b/roojs-ui-debug.js index e6059e96f4..22d5aeb0d4 100644 --- a/roojs-ui-debug.js +++ b/roojs-ui-debug.js @@ -21810,7 +21810,7 @@ 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/)) { + if (ns.hasAttribute('style') && ns.getAttribute('style').match(/mso-list/)) { items.push(ns); ns = ns.nextSibling; has_list = true; @@ -21822,7 +21822,7 @@ Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter, } var has_list = false; for(var i = 0; i < spans.length; i++) { - if (spans[i].getAttribute('style').match(/mso-list/)) { + if (spans[i].hasAttribute('style') && spans[i].getAttribute('style').match(/mso-list/)) { has_list = true; break; } diff --git a/roojs-ui.js b/roojs-ui.js index 90e9b940e9..fd99407aa6 100644 --- a/roojs-ui.js +++ b/roojs-ui.js @@ -989,9 +989,9 @@ var C={};Roo.each(B,function(s){if(!s.match(/:/)){return;}var kv=s.split(":");C[ }if(a.hasAttribute("href")){continue;}this.removeNodeKeepChildren(a);}},replaceDocBullets:function(A){var B=A.getElementsByClassName('MsoListParagraphCxSpFirst');for(var i=0;iF){var N=B.createElement('ul'); if(!H){H=B.createElement('li');G[F].appendChild(H);}H.appendChild(N);G[nlvl]=N;}F=nlvl;var O=G[nlvl].appendChild(B.createElement('li'));H=O;O.innerHTML=n.innerHTML;A.removeChild(n);},this);}}); // Roo/htmleditor/FilterStyleToTag.js -- 2.39.2