org.pkl.thirdparty.commonmark.parser.beta.LinkInfo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pkl-tools Show documentation
Show all versions of pkl-tools Show documentation
Fat Jar containing pkl-cli, pkl-codegen-java, pkl-codegen-kotlin, pkl-config-java, pkl-core, pkl-doc, and their shaded third-party dependencies.
package org.pkl.thirdparty.commonmark.parser.beta;
import org.pkl.thirdparty.commonmark.node.Text;
/**
* A parsed link/image. There are different types of links.
*
* Inline links:
*
* [text](destination)
* [text](destination "title")
*
*
* Reference links, which have different subtypes. Full::
*
* [text][label]
*
* Collapsed (label is ""):
*
* [text][]
*
* Shortcut (label is null):
*
* [text]
*
* Images use the same syntax as links but with a {@code !} {@link #marker()} front, e.g. {@code ![text](destination)}.
*/
public interface LinkInfo {
/**
* The marker if present, or null. A marker is e.g. {@code !} for an image, or a custom marker as specified in
* {@link org.pkl.thirdparty.commonmark.parser.Parser.Builder#linkMarker}.
*/
Text marker();
/**
* The text node of the opening bracket {@code [}.
*/
Text openingBracket();
/**
* The text between the first brackets, e.g. `foo` in `[foo][bar]`.
*/
String text();
/**
* The label, or null for inline links or for shortcut links (in which case {@link #text()} should be used as the label).
*/
String label();
/**
* The destination if available, e.g. in `[foo](destination)`, or null
*/
String destination();
/**
* The title if available, e.g. in `[foo](destination "title")`, or null
*/
String title();
/**
* The position after the closing text bracket, e.g.:
*
* [foo][bar]
* ^
*
*/
Position afterTextBracket();
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy