suneditor 2.44.2 → 2.44.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "suneditor",
3
- "version": "2.44.2",
3
+ "version": "2.44.3",
4
4
  "description": "Pure JavaScript based WYSIWYG web editor",
5
5
  "author": "JiHong.Lee",
6
6
  "license": "MIT",
package/src/lib/core.js CHANGED
@@ -1691,26 +1691,30 @@ export default function (context, pluginCallButtons, plugins, lang, options, _re
1691
1691
  let duple = false;
1692
1692
  (function recursionFunc(ancestor) {
1693
1693
  if (util.isWysiwygDiv(ancestor) || !util.isTextStyleElement(ancestor)) return;
1694
-
1695
1694
  if (ancestor.nodeName === nodeName) {
1696
1695
  duple = true;
1697
- (ancestor.style.cssText.match(/[^;]+;/g) || []).forEach(function(v){
1698
- let i;
1699
- if ((i = oStyles.indexOf(v.trim())) > -1) {
1700
- oStyles.splice(i, 1);
1696
+ const styles = ancestor.style.cssText.match(/[^;]+;/g) || [];
1697
+ for (let i = 0, len = styles.length, j; i < len; i++) {
1698
+ if ((j = oStyles.indexOf(styles[i].trim())) > -1) {
1699
+ oStyles.splice(j, 1);
1701
1700
  }
1702
- });
1703
- ancestor.classList.forEach(function(v){
1704
- oNode.classList.remove(v);
1705
- });
1701
+ }
1702
+ for (let i = 0, len = ancestor.classList.length; i < len; i++) {
1703
+ oNode.classList.remove(ancestor.classList[i]);
1704
+ }
1706
1705
  }
1707
1706
 
1708
1707
  recursionFunc(ancestor.parentElement);
1709
1708
  })(parentNode);
1710
1709
 
1711
1710
  if (duple) {
1712
- if (!(oNode.style.cssText = oStyles.join(' '))) oNode.removeAttribute('style');
1713
- if (!oNode.attributes.length) oNode.setAttribute('data-se-duple', 'true');
1711
+ if (!(oNode.style.cssText = oStyles.join(' '))) {
1712
+ oNode.setAttribute('style', '');
1713
+ oNode.removeAttribute('style');
1714
+ }
1715
+ if (!oNode.attributes.length) {
1716
+ oNode.setAttribute('data-se-duple', 'true');
1717
+ }
1714
1718
  }
1715
1719
 
1716
1720
  return oNode;