Package-level declarations

Types

Link copied to clipboard
class DelimiterRun(val char: Char, val originalLength: Int, val canOpen: Boolean, val canClose: Boolean, var start: Int, var length: Int)

A run of identical emphasis delimiter characters, classified per CommonMark 0.31.2 section 6.2.

Link copied to clipboard

Classification of delimiter runs. A position outside the source counts as whitespace, which is how CommonMark treats the start and the end of a line.

Link copied to clipboard
class InlineMatch(val piece: InlinePiece, val end: Int)

What an InlineRecognizer produced at a position.

Link copied to clipboard
sealed interface InlinePiece

One element of the inline scan's first pass. Emphasis pairing needs the whole run before it can decide what nests inside what, so the first pass stops at these three shapes and the second pass resolves them.

Link copied to clipboard
fun interface InlineRecognizer

A strategy that attempts to produce an inline piece at a position.

Link copied to clipboard
class InlineScanLexer(source: CharSequence, recognizers: List<InlineRecognizer>, fill: (TokenData) -> Token?) : Lexer

A Lexer that scans inline-level tokens in two passes.

Link copied to clipboard
class TargetMatch(val url: String, val title: String?)

A link destination with its optional title.

Functions

Link copied to clipboard
fun inlineMatch(source: CharSequence, start: Int, end: Int, wrap: (TokenData) -> Token): InlineMatch

Builds a match whose token covers a source span.

Link copied to clipboard

Consumes a backtick-delimited span, which a label treats as opaque.

Link copied to clipboard
fun <T : Any> Scanner.takeLabel(closes: Scanner.() -> T?): Pair<String, T>?

Consumes the bracketed label shared by links, reference links, images and reference images.

Link copied to clipboard

Consumes a parenthesized destination with its optional title.