Skip to content

Commit

Permalink
fix: #1075 #1091 paste data error
Browse files Browse the repository at this point in the history
  • Loading branch information
JiHong88 committed Sep 21, 2022
1 parent 6d53a1e commit 2532b16
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -5338,7 +5338,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)).replace(/^.+\x3C!--StartFragment--\>|\x3C!--EndFragment-->.+$/g, '');
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 {
Expand Down Expand Up @@ -7819,6 +7819,7 @@ export default function (context, pluginCallButtons, plugins, lang, options, _re
const onlyText = !cleanData;

if (!onlyText) {
cleanData = cleanData.replace(/^<html>\r\n<body>\r\n\x3C!--StartFragment--\>|\x3C!--EndFragment-->\r\n<\/body\>\r\n<\/html>$/g, '');
if (MSData) {
cleanData = cleanData.replace(/\n/g, ' ');
plainText = plainText.replace(/\n/g, ' ');
Expand Down

0 comments on commit 2532b16

Please sign in to comment.