mirror of
https://github.com/cudr/slate-collaborative.git
synced 2025-06-13 12:54:04 +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 ops: any = []
|
||||||
|
|
||||||
const iterate = ({ children, ...json }: any, path: 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
|
const node = children ? { ...json, children: [] } : json
|
||||||
|
|
||||||
ops.push({
|
ops.push({
|
||||||
|
Loading…
Reference in New Issue
Block a user