Skip to content

Commit

Permalink
2.44.6
Browse files Browse the repository at this point in the history
  • Loading branch information
JiHong88 committed Mar 31, 2023
2 parents e4f649b + 3ba052e commit e9445ad
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion dist/css/suneditor.min.css

Large diffs are not rendered by default.

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
@@ -1,6 +1,6 @@
{
"name": "suneditor",
"version": "2.44.5",
"version": "2.44.6",
"description": "Pure JavaScript based WYSIWYG web editor",
"author": "JiHong.Lee",
"license": "MIT",
Expand Down
10 changes: 5 additions & 5 deletions src/lib/core.js
Expand Up @@ -5082,11 +5082,10 @@ export default function (context, pluginCallButtons, plugins, lang, options, _re
setContents: function (html) {
this.removeRange();

const convertValue = (html === null || html === undefined) ? '' : this.cleanHTML(html, null, null);
this._resetComponents();

const convertValue = (html === null || html === undefined) ? '' : this.convertContentsForEditor(html, null, null);
if (!this._variable.isCodeView) {
context.element.wysiwyg.innerHTML = convertValue;
this._resetComponents();
// history stack
this.history.push(false);
} else {
Expand All @@ -5103,6 +5102,7 @@ export default function (context, pluginCallButtons, plugins, lang, options, _re
if (!options.iframe) return false;
if (ctx.head) this._wd.head.innerHTML = ctx.head.replace(/<script[\s\S]*>[\s\S]*<\/script>/gi, '');
if (ctx.body) this._wd.body.innerHTML = this.convertContentsForEditor(ctx.body);
this._resetComponents();
},

/**
Expand Down Expand Up @@ -5153,6 +5153,7 @@ export default function (context, pluginCallButtons, plugins, lang, options, _re
// element
if (node.nodeType === 1) {
if (util._disallowedTags(node)) return '';
if (/__se__tag/.test(node.className)) return node.outerHTML;

const ch = util.getListChildNodes(node, function(current) { return util.isSpanWithoutAttr(current) && !util.getParentElement(current, util.isNotCheckingNode); }) || [];
for (let i = ch.length - 1; i >= 0; i--) {
Expand Down Expand Up @@ -5457,7 +5458,6 @@ export default function (context, pluginCallButtons, plugins, lang, options, _re
*/
cleanHTML: function (html, whitelist, blacklist) {
html = this._deleteDisallowedTags(this._parser.parseFromString(html, 'text/html').body.innerHTML).replace(/(<[a-zA-Z0-9\-]+)[^>]*(?=>)/g, this._cleanTags.bind(this, true));

const dom = _d.createRange().createContextualFragment(html);
try {
util._consistencyCheckOfHTML(dom, this._htmlCheckWhitelistRegExp, this._htmlCheckBlacklistRegExp, true);
Expand Down Expand Up @@ -5536,7 +5536,7 @@ export default function (context, pluginCallButtons, plugins, lang, options, _re
for (let i = 0, t; i < domTree.length; i++) {
t = domTree[i];

if (!util.isFormatElement(t) && !util.isRangeFormatElement(t) && !util.isComponent(t) && !util.isMedia(t) && t.nodeType !== 8) {
if (!util.isFormatElement(t) && !util.isRangeFormatElement(t) && !util.isComponent(t) && !util.isMedia(t) && t.nodeType !== 8 && !/__se__tag/.test(t.className)) {
if (!p) p = util.createElement(options.defaultTag);
p.appendChild(t);
i--;
Expand Down

0 comments on commit e9445ad

Please sign in to comment.