Skip to content

Commit

Permalink
2.44.3
Browse files Browse the repository at this point in the history
  • Loading branch information
JiHong88 authored Oct 8, 2022
2 parents 5747f10 + 468afe6 commit 8343dec
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
4 changes: 2 additions & 2 deletions dist/suneditor.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "suneditor",
"version": "2.44.2",
"version": "2.44.3",
"description": "Pure JavaScript based WYSIWYG web editor",
"author": "JiHong.Lee",
"license": "MIT",
Expand Down
26 changes: 15 additions & 11 deletions src/lib/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -1691,26 +1691,30 @@ export default function (context, pluginCallButtons, plugins, lang, options, _re
let duple = false;
(function recursionFunc(ancestor) {
if (util.isWysiwygDiv(ancestor) || !util.isTextStyleElement(ancestor)) return;

if (ancestor.nodeName === nodeName) {
duple = true;
(ancestor.style.cssText.match(/[^;]+;/g) || []).forEach(function(v){
let i;
if ((i = oStyles.indexOf(v.trim())) > -1) {
oStyles.splice(i, 1);
const styles = ancestor.style.cssText.match(/[^;]+;/g) || [];
for (let i = 0, len = styles.length, j; i < len; i++) {
if ((j = oStyles.indexOf(styles[i].trim())) > -1) {
oStyles.splice(j, 1);
}
});
ancestor.classList.forEach(function(v){
oNode.classList.remove(v);
});
}
for (let i = 0, len = ancestor.classList.length; i < len; i++) {
oNode.classList.remove(ancestor.classList[i]);
}
}

recursionFunc(ancestor.parentElement);
})(parentNode);

if (duple) {
if (!(oNode.style.cssText = oStyles.join(' '))) oNode.removeAttribute('style');
if (!oNode.attributes.length) oNode.setAttribute('data-se-duple', 'true');
if (!(oNode.style.cssText = oStyles.join(' '))) {
oNode.setAttribute('style', '');
oNode.removeAttribute('style');
}
if (!oNode.attributes.length) {
oNode.setAttribute('data-se-duple', 'true');
}
}

return oNode;
Expand Down

0 comments on commit 8343dec

Please sign in to comment.