Fix sanitize config on paste (#471)

This commit is contained in:
George Berezhnoy 2018-10-10 22:32:17 +03:00 committed by GitHub
parent ad75ceaf05
commit 53f58584b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 341 additions and 337 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,6 +1,6 @@
{
"name": "codex.editor",
"version": "2.1.1",
"version": "2.1.2",
"description": "Codex Editor. Native JS, based on API and Open Source",
"main": "build/codex-editor.js",
"scripts": {

View file

@ -147,7 +147,7 @@ export default class Paste extends Module {
return result;
}, {});
const customConfig = {tags: Object.assign({}, toolsTags, Sanitizer.defaultConfig.tags)};
const customConfig = Object.assign({}, toolsTags, Sanitizer.defaultConfig.tags);
const cleanData = Sanitizer.clean(htmlData, customConfig);
/** If there is no HTML or HTML string is equal to plain one, process it as plain text */
@ -515,7 +515,7 @@ export default class Paste extends Module {
return result;
}, {});
const customConfig = {tags: Object.assign({}, toolTags, Sanitizer.defaultConfig.tags)};
const customConfig = Object.assign({}, toolTags, Sanitizer.defaultConfig.tags);
content.innerHTML = Sanitizer.clean(content.innerHTML, customConfig);