Package org.commonmark.parser.beta
Interface LinkResult
- All Known Implementing Classes:
LinkResultImpl
public interface LinkResult
What to do with a link/image processed by
LinkProcessor
.-
Method Summary
Modifier and TypeMethodDescriptionIf aLinkInfo.marker()
is present, include it in processing (i.e.static LinkResult
none()
Link not handled by processor.static LinkResult
replaceWith
(Node node, Position position) Replace the link with a node.static LinkResult
wrapTextIn
(Node node, Position position) Wrap the link text in a node.
-
Method Details
-
none
Link not handled by processor. -
wrapTextIn
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 aLink
node, 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
Replace the link with a node. E.g. for this:
The processor could decide to create a[^foo]
FootnoteReference
node 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).
-