LexicalExportVisitor interface

Implement this interface in order to process mdast node(s) into a lexical tree. This is part of the process that converts the editor contents to markdown.

Signature:

export interface LexicalExportVisitor<LN extends LexicalNode, UN extends Mdast.Content> 

Properties

PropertyModifiersTypeDescription
priority?number(Optional) Default 0, optional, sets the priority of the visitor. The higher the number, the earlier it will be called.

Methods

MethodDescription
join(prevNode, currentNode)?(Optional) Join the current node with the previous node, returning the resulting new node For this to be called by the tree walk, shouldJoin must return true.
shouldJoin(prevNode, currentNode)?(Optional) Return true if the current node should be joined with the previous node. This is necessary due to some inconsistencies between the lexical tree and the mdast tree when it comes to formatting.
testLexicalNode(lexicalNode)?(Optional) Return true if the given node is of the type that this visitor can process. You can safely use the node type guard functions (as in $isParagraphNode, $isLinkNode, etc.) here.
visitLexicalNode(params)?(Optional) Process the given node and manipulate the mdast tree accordingly.