UNPKG

@mkljczk/lexical-remark

Version:

This package contains Markdown helpers and functionality for Lexical using remark-parse.

12 lines (11 loc) 325 B
export const heading = (node, { rootHandler }) => { const remarkNode = { children: node .getChildren() .map((child) => rootHandler(child, { rootHandler })) .filter((child) => !!child), depth: +node.getTag()[1], type: 'heading', }; return remarkNode; };