You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all, what seems to be wrong with this normalization logic:
editor.normalizeNode=entry=>{const[node,path]=entry;// If the element is a paragraph, then move this image to another block.if(Element.isElement(node)&&node.type==='paragraph'){for(const[child,childPath]ofNode.children(editor,path)){if(Element.isElement(child)&&child.type==='image'){Transforms.unwrapNodes(editor,{split: true,at: childPath});return;}}}// Fall back to the original `normalizeNode` to enforce other constraints.normalizeNode(entry)}
the Transforms.unwrapNodes(editor, { split: true, at: childPath }); does not unwrap the image. What am I missing, any help is appreciated :)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi all, what seems to be wrong with this normalization logic:
the
Transforms.unwrapNodes(editor, { split: true, at: childPath });
does not unwrap the image. What am I missing, any help is appreciated :)I am new to slate.. ;-)
Beta Was this translation helpful? Give feedback.
All reactions