1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-29 09:59:48 +02:00

fix images example schema (#2091)

This commit is contained in:
Bryan Haakman
2018-08-21 18:49:05 +02:00
committed by Ian Storm Taylor
parent fa343c07f4
commit 3ac1b13ce3

View File

@@ -62,8 +62,8 @@ function insertImage(change, src, target) {
const schema = { const schema = {
document: { document: {
last: { type: 'paragraph' }, last: { type: 'paragraph' },
normalize: (change, reason, { node, child }) => { normalize: (change, { code, node, child }) => {
switch (reason) { switch (code) {
case LAST_CHILD_TYPE_INVALID: { case LAST_CHILD_TYPE_INVALID: {
const paragraph = Block.create('paragraph') const paragraph = Block.create('paragraph')
return change.insertNodeByKey(node.key, node.nodes.size, paragraph) return change.insertNodeByKey(node.key, node.nodes.size, paragraph)