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/dist/suneditor.min.js +2 -2
- package/package.json +1 -1
- package/src/lib/core.js +17 -13
package/package.json
CHANGED
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
|
-
|
|
1698
|
-
|
|
1699
|
-
if ((
|
|
1700
|
-
oStyles.splice(
|
|
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.
|
|
1704
|
-
oNode.classList.remove(
|
|
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(' ')))
|
|
1713
|
-
|
|
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.
|
|
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, '');
|