MdastVisitActions interface

A set of actions that can be used to modify the lexical tree while visiting the mdast tree.

Signature:

export interface MdastVisitActions 

Methods

MethodDescription
addAndStepInto(lexicalNode)Add the given node to the lexical tree, and iterate the current mdast node's children with the newly created lexical node as a parent.
addFormatting(format, node)Adds formatting as a context for the current node and its children. This is necessary due to mdast treating formatting as a node, while lexical considering it an attribute of a node.
getParentFormatting()Access the current formatting context.
removeFormatting(format, node)Adds formatting as a context for the current node and its children. This is necessary due to mdast treating formatting as a node, while lexical considering it an attribute of a node.
visitChildren(node, lexicalParent)Iterate the children of the node with the lexical node as the parent.