1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-02-01 05:16:10 +01: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 = {
document: {
last: { type: 'paragraph' },
normalize: (change, reason, { node, child }) => {
switch (reason) {
normalize: (change, { code, node, child }) => {
switch (code) {
case LAST_CHILD_TYPE_INVALID: {
const paragraph = Block.create('paragraph')
return change.insertNodeByKey(node.key, node.nodes.size, paragraph)