diff --git a/lib/plugins/core.js b/lib/plugins/core.js index bfab49468..38c9f4cd4 100644 --- a/lib/plugins/core.js +++ b/lib/plugins/core.js @@ -284,18 +284,21 @@ function Plugin(options = {}) { */ onPaste(e, paste, state, editor) { - if (paste.type == 'files') return + switch (paste.type) { + case 'text': + case 'html': { + let transform = state.transform() - let transform = state.transform() + paste.text + .split('\n') + .forEach((line, i) => { + if (i > 0) transform = transform.splitBlock() + transform = transform.insertText(line) + }) - paste.text - .split('\n') - .forEach((line, i) => { - if (i > 0) transform = transform.splitBlock() - transform = transform.insertText(line) - }) - - return transform.apply() + return transform.apply() + } + } }, /**