mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-16 12:14:14 +02:00
refactor core onPaste handler
This commit is contained in:
@@ -284,8 +284,9 @@ function Plugin(options = {}) {
|
||||
*/
|
||||
|
||||
onPaste(e, paste, state, editor) {
|
||||
if (paste.type == 'files') return
|
||||
|
||||
switch (paste.type) {
|
||||
case 'text':
|
||||
case 'html': {
|
||||
let transform = state.transform()
|
||||
|
||||
paste.text
|
||||
@@ -296,6 +297,8 @@ function Plugin(options = {}) {
|
||||
})
|
||||
|
||||
return transform.apply()
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user