type
Node
src
@Js
abstract class Node : Obj
Base class for all CommonMark AST nodes.
The CommonMark AST is a tree of nodes where each node can have any number of children and one parent - except the root node which has no parent.
constructors
fields
methods
addSourceSpan |
Add a source span to the end of the list. |
---|---|
appendChild |
Insert the child node as the last child node of this node. |
children |
Get all the children of the given parent node |
eachBetween |
Get nodes between start (exclusive) and end (exclusive) |
find |
Recursively try to find a node with the given type within the children of the specified node. |
insertAfter |
Inserts the sibling node after this node |
insertBefore |
Inserts the sibiling node before this node |
parent |
The parent node or null if this is the root of the AST |
setParent |
Used by sub-classes to set or clear this node's parent |
setSourceSpans |
Replace the current source spans with the provided list |
toStr | |
toStrAttributes | |
tryFind |
Recursively try to find a node with the given type within the children of the specified node. |
unlink |
Completely detach this node from the AST |
walk |
Walk the AST using the given visitor. |
Slot Details
addSourceSpan
src
Void addSourceSpan(SourceSpan? sourceSpan)
Add a source span to the end of the list. If it is null, this is a no-op
appendChild
children
eachBetween
find
firstChild
insertAfter
insertBefore
lastChild
make
src
new make()
next
parent
prev
setParent
setSourceSpans
src
Void setSourceSpans(SourceSpan[] sourceSpans)
Replace the current source spans with the provided list
sourceSpans
src
SourceSpan[]? sourceSpans := null { private set }