Block

sealed interface Block

A node in the block structure of a CommonMark document.

Block nodes form the top-level structure of a document. The sealed hierarchy mirrors the block node types defined in the CommonMark 0.31.2 specification.

Inheritors

Types

Link copied to clipboard

Column alignment in a GFM table.

Link copied to clipboard
data object BlankLine : Block

A blank line. Consumed during the block pass and not usually emitted into the final document tree.

Link copied to clipboard
data class BlockQuote(val blocks: List<Block>) : Block

A block quotation (> ...).

Link copied to clipboard
data class BulletList(val tight: Boolean, val marker: Char, val items: List<Block.ListItem>) : Block

An unordered (bullet) list.

Link copied to clipboard
data class FencedCodeBlock(val info: String?, val literal: String) : Block

A fenced code block delimited by backtick or tilde runs.

Link copied to clipboard
data class Heading(val level: Int, val inlines: List<Inline>) : Block

An ATX or Setext heading.

Link copied to clipboard
data class HtmlBlock(val literal: String) : Block

A raw HTML block. One of the seven HTML block types defined by the spec.

Link copied to clipboard
data class IndentedCodeBlock(val literal: String) : Block

A block of code indented by 4 spaces (or 1 tab).

Link copied to clipboard
data class LinkReferenceDefinition(val label: String, val destination: String, val title: String?) : Block

A link reference definition ([label]: destination "title").

Link copied to clipboard
data class ListItem(val blocks: List<Block>, val checked: Boolean? = null) : Block

A single list item, containing one or more block nodes.

Link copied to clipboard
data class OrderedList(val tight: Boolean, val start: Int, val delimiter: Char, val items: List<Block.ListItem>) : Block

An ordered list.

Link copied to clipboard
data class Paragraph(val inlines: List<Inline>) : Block

A paragraph of inline content.

Link copied to clipboard
data class Table(val alignments: List<Block.Alignment>, val header: Block.TableRow, val body: List<Block.TableRow>) : Block

A GFM table (extension).

Link copied to clipboard
data class TableCell(val inlines: List<Inline>) : Block

A single cell in a table row.

Link copied to clipboard
data class TableRow(val cells: List<Block.TableCell>) : Block

A row of cells in a table.

Link copied to clipboard
data object ThematicBreak : Block

A thematic break (---, ***, or ___).