mirror of
https://github.com/codex-team/editor.js
synced 2024-06-29 10:50:23 +02:00
Sanitize pasted block data (#1430)
This commit is contained in:
parent
113e895d20
commit
bfd0ea10ea
2
dist/editor.js
vendored
2
dist/editor.js
vendored
File diff suppressed because one or more lines are too long
|
@ -5,6 +5,8 @@
|
||||||
- `Fix` - The problem with destroy() method [#1380](https://github.com/codex-team/editor.js/issues/1380).
|
- `Fix` - The problem with destroy() method [#1380](https://github.com/codex-team/editor.js/issues/1380).
|
||||||
- `Fix` - add getter keyword to `block.mergeable` method [#1415](https://github.com/codex-team/editor.js/issues/1415).
|
- `Fix` - add getter keyword to `block.mergeable` method [#1415](https://github.com/codex-team/editor.js/issues/1415).
|
||||||
- `Fix` — Fix problem with entering to Editor.js by Tab key [#1393](https://github.com/codex-team/editor.js/issues/1393)
|
- `Fix` — Fix problem with entering to Editor.js by Tab key [#1393](https://github.com/codex-team/editor.js/issues/1393)
|
||||||
|
- `Fix` - Sanitize pasted block data [#1396](https://github.com/codex-team/editor.js/issues/1396).
|
||||||
|
|
||||||
|
|
||||||
### 2.19
|
### 2.19
|
||||||
|
|
||||||
|
|
|
@ -760,9 +760,10 @@ export default class Paste extends Module {
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
private insertEditorJSData(blocks: Array<Pick<SavedData, 'data' | 'tool'>>): void {
|
private insertEditorJSData(blocks: Array<Pick<SavedData, 'data' | 'tool'>>): void {
|
||||||
const { BlockManager, Tools } = this.Editor;
|
const { BlockManager, Sanitizer, Tools } = this.Editor;
|
||||||
|
const sanitizedBlocks = Sanitizer.sanitizeBlocks(blocks);
|
||||||
|
|
||||||
blocks.forEach(({ tool, data }, i) => {
|
sanitizedBlocks.forEach(({ tool, data }, i) => {
|
||||||
let needToReplaceCurrentBlock = false;
|
let needToReplaceCurrentBlock = false;
|
||||||
|
|
||||||
if (i === 0) {
|
if (i === 0) {
|
||||||
|
|
Loading…
Reference in a new issue