+ {
+ replace: HeadingNode,
+ with: (node: HeadingNode) => {
+ return new CustomHeadingNode(node.__tag);
+ }
+ },
+ {
+ replace: QuoteNode,
+ with: (node: QuoteNode) => {
+ return new CustomQuoteNode();
+ }
+ },
+ {
+ replace: ListNode,
+ with: (node: ListNode) => {
+ return new CustomListNode(node.getListType(), node.getStart());
+ }
+ },
+ {
+ replace: ListItemNode,
+ with: (node: ListItemNode) => {
+ return new CustomListItemNode(node.__value, node.__checked);
+ }
+ },
+ {
+ replace: TableNode,
+ with(node: TableNode) {
+ return new CustomTableNode();
+ }
+ },
+ {
+ replace: TableRowNode,
+ with(node: TableRowNode) {
+ return new CustomTableRowNode();
+ }
+ },
+ {
+ replace: TableCellNode,
+ with: (node: TableCellNode) => {
+ const cell = new CustomTableCellNode(
+ node.__headerState,
+ node.__colSpan,
+ node.__width,
+ );
+ cell.__rowSpan = node.__rowSpan;
+ return cell;
+ }
+ },