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/dist/suneditor.min.js +2 -2
- package/package.json +1 -1
- package/src/lib/core.js +15 -11
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;
|