Skip to content

Commit

Permalink
2.43.10
Browse files Browse the repository at this point in the history
  • Loading branch information
JiHong88 authored Jun 18, 2022
2 parents 8e42f40 + 1ac9dad commit 8d3f9f0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 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.43.9",
"version": "2.43.10",
"description": "Pure JavaScript based WYSIWYG web editor",
"author": "JiHong.Lee",
"license": "MIT",
Expand Down
8 changes: 3 additions & 5 deletions src/lib/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -5299,7 +5299,7 @@ export default function (context, pluginCallButtons, plugins, lang, options, _re
* @returns {String}
*/
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));
html = this._deleteDisallowedTags(this._parser.parseFromString(html, 'text/html').body.innerHTML).replace(/(<[a-zA-Z0-9\-]+)[^>]*(?=>)/g, this._cleanTags.bind(this, true)).replace(/^.+\x3C!--StartFragment--\>|\x3C!--EndFragment-->.+$/g, '');

const dom = _d.createRange().createContextualFragment(html);
try {
Expand Down Expand Up @@ -5379,7 +5379,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)) {
if (!util.isFormatElement(t) && !util.isRangeFormatElement(t) && !util.isComponent(t) && !util.isMedia(t) && t.nodeType !== 8) {
if (!p) p = util.createElement(options.defaultTag);
p.appendChild(t);
i--;
Expand Down Expand Up @@ -6333,7 +6333,6 @@ export default function (context, pluginCallButtons, plugins, lang, options, _re

onMouseDown_wysiwyg: function (e) {
if (core.isReadOnly || util.isNonEditable(context.element.wysiwyg)) return;
core._editorRange();

// user event
if (typeof functions.onMouseDown === 'function' && functions.onMouseDown(e, core) === false) return;
Expand Down Expand Up @@ -7359,8 +7358,7 @@ export default function (context, pluginCallButtons, plugins, lang, options, _re
}
}

const textKey = !ctrl && !alt && !selectRange && !event._nonTextKeyCode.test(keyCode);
if (textKey && range.collapsed && range.startContainer === range.endContainer && util.isBreak(range.commonAncestorContainer)) {
if (util.isIE && !ctrl && !alt && !selectRange && !event._nonTextKeyCode.test(keyCode) && util.isBreak(range.commonAncestorContainer)) {
const zeroWidth = util.createTextNode(util.zeroWidthSpace);
core.insertNode(zeroWidth, null, false);
core.setRange(zeroWidth, 1, zeroWidth, 1);
Expand Down

0 comments on commit 8d3f9f0

Please sign in to comment.