UNPKG

@mdxeditor/editor

Version:

React component for rich text markdown editing

11 lines (10 loc) 270 B
import { $createHeadingNode } from "@lexical/rich-text"; const MdastHeadingVisitor = { testNode: "heading", visitNode: function({ mdastNode, actions }) { actions.addAndStepInto($createHeadingNode(`h${mdastNode.depth}`)); } }; export { MdastHeadingVisitor };