suneditor 2.44.1 → 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.1",
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;
@@ -5196,7 +5200,7 @@ export default function (context, pluginCallButtons, plugins, lang, options, _re
5196
5200
  case '%':
5197
5201
  return (pxSize * 0.0625).toFixed(2) + to;
5198
5202
  case 'pt':
5199
- return this._w.Math.floor(pxSize / 1.333) + to;
5203
+ return this.floor(pxSize / 1.333) + to;
5200
5204
  default: // px
5201
5205
  return pxSize + to;
5202
5206
  }
@@ -5210,7 +5214,7 @@ export default function (context, pluginCallButtons, plugins, lang, options, _re
5210
5214
  if (style) {
5211
5215
  const allowedStyle = [];
5212
5216
  for (let i = 0, len = style.length, r; i < len; i++) {
5213
- r = style[i].match(/(.+)(:)([^:]+$)/);
5217
+ r = style[i].match(/([a-zA-Z0-9-]+)(:)([^:]+$)/);
5214
5218
  if (r && !/inherit|initial/i.test(r[3])) {
5215
5219
  const k = util.kebabToCamelCase(r[1].trim());
5216
5220
  const v = this.wwComputedStyle[k].replace(/"/g, '');