Package org.commonmark.parser.beta
Interface LinkResult
-
- All Known Implementing Classes:
LinkResultImpl
public interface LinkResultWhat to do with a link/image processed byLinkProcessor.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description LinkResultincludeMarker()If aLinkInfo.marker()is present, include it in processing (i.e.static LinkResultnone()Link not handled by processor.static LinkResultreplaceWith(Node node, Position position)Replace the link with a node.static LinkResultwrapTextIn(Node node, Position position)Wrap the link text in a node.
-
-
-
Method Detail
-
none
static LinkResult none()
Link not handled by processor.
-
wrapTextIn
static LinkResult wrapTextIn(Node node, Position position)
Wrap the link text in a node. This is the normal behavior for links, e.g. for this:
The text is[my *text*](destination)my *text*, a text node and emphasis. The text is wrapped in aLinknode, which means the text is added as child nodes to it.- Parameters:
node- the node to which the link text nodes will be added as child nodesposition- the position to continue parsing from
-
replaceWith
static LinkResult replaceWith(Node node, Position position)
Replace the link with a node. E.g. for this:
The processor could decide to create a[^foo]FootnoteReferencenode instead which replaces the link.- Parameters:
node- the node to replace the link withposition- the position to continue parsing from
-
includeMarker
LinkResult includeMarker()
If aLinkInfo.marker()is present, include it in processing (i.e. treat it the same way as the brackets).
-
-