mirror of
https://github.com/cudr/slate-collaborative.git
synced 2024-10-27 20:34:06 +00:00
fix: insert node behavior
This commit is contained in:
parent
1b2f6693ee
commit
4c49a37fdb
@ -19,6 +19,15 @@ const insertNodeOp = (
|
||||
const ops: any = []
|
||||
|
||||
const iterate = ({ children, ...json }: any, path: any) => {
|
||||
if (children && children.length === 1 && children[0].text === '') {
|
||||
ops.push({
|
||||
type: 'insert_node',
|
||||
path,
|
||||
node: { children, ...json }
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
const node = children ? { ...json, children: [] } : json
|
||||
|
||||
ops.push({
|
||||
|
Loading…
Reference in New Issue
Block a user