UNPKG

@liveblocks/react-ui

Version:

A set of React pre-built components for the Liveblocks products. Liveblocks is the all-in-one toolkit to build collaborative products like Figma, Notion, and more.

22 lines (19 loc) 610 B
import { Element, Node, Transforms } from 'slate'; function withNormalize(editor) { const { normalizeNode } = editor; editor.normalizeNode = (entry) => { const [node, path] = entry; if (Element.isElement(node) && node.type === "paragraph") { for (const [child, childPath] of Node.children(editor, path)) { if (Element.isElement(child) && !editor.isInline(child)) { Transforms.unwrapNodes(editor, { at: childPath }); return; } } } normalizeNode(entry); }; return editor; } export { withNormalize }; //# sourceMappingURL=normalize.js.map