1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-17 20:51:20 +02:00

refactor core onPaste handler

This commit is contained in:
Ian Storm Taylor
2016-07-22 17:00:04 -07:00
parent ebb1625e29
commit 2df1fe7e6b

View File

@@ -284,8 +284,9 @@ function Plugin(options = {}) {
*/ */
onPaste(e, paste, state, editor) { 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 paste.text
@@ -296,6 +297,8 @@ function Plugin(options = {}) {
}) })
return transform.apply() return transform.apply()
}
}
}, },
/** /**