Skip to content

Reference ​

36 classes, interfaces, traits and enums, read from src/.

  • Attributes: The id and the CSS classes that a "{#id .class}" block sets on an element.
  • AtxHeading: A heading written with one to six "#": "## Title", with "#" at the end if you like.
  • BlockContext: What a rule needs to read a block: the parsers of the blocks and of the text, and whether the paragraphs are written without <p> (in a tight list).
  • BlockParser: Reads the lines of a text block by block, with the first kind of block that matches, and gives the HTML.
  • BlockRule: A kind of block: a heading, a code block, a quote, a list, a table, a rule, a paragraph.
  • FencedCode: Code between two lines of three backticks or more (or three tildes or more). The word after the opening fence is the language, written as a class "language-php", and "{#id .class}" after it are the attributes.
  • HtmlBlock: A block of HTML written in the text, kept as it is up to the next blank line. It is only read when the option asks for it.
  • IndentedCode: Code indented by four spaces or one tab.
  • Interrupts: Tells whether a line starts a block that can interrupt a paragraph, a quote or a list item.
  • ItemBuilder: The lines of a list item that is being read.
  • ItemReader: Reads the lines of a list item: the ones that are indented as far as its text, the blank lines between them, and the lines of text that go on with a paragraph without being indented.
  • ListItem: The lines of one list item, without their indentation, and whether a blank line separates its blocks.
  • ListMarker: The start of a list item: "-", "*" or "+" for a bullet, "1." or "1)" for a number. What follows the marker is the first line of the item, and the lines that go on with it are indented as far as this text.
  • Lists: Bulleted and numbered lists, nested by indentation. A list is loose when a blank line separates its items or the blocks of an item: its text is then in paragraphs; otherwise the text is written without <p>.
  • Paragraph: Lines of text up to a blank line or to a block that interrupts them. A line of "=" or of "-" under the text makes it a heading (the underlined style of the original Markdown), and "{#id .class}" at the end of the text gives its attributes.
  • Quote: Lines that start with ">". What is inside is read as blocks, so a quote can hold headings, lists, code and quotes. A line of text without ">" right after a line of text goes on with it.
  • Table: A table written with bars, as on GitHub: a line of headers, a line of dashes whose colons align the columns, then the rows.
  • ThematicBreak: Three characters or more, "-", "*" or "_", alone on a line.
  • Convert: KMark converts Markdown to HTML, as the original Markdown does, and lets you set an id and CSS classes on the elements with "{#id .class}".
  • Html: Small helpers to write HTML.
  • AutoLinks: A URL or an email address between < and >.
  • BareUrls: The "http://" and "https://" URLs written in a text. They become links, or stay as text when the option says so; either way nothing reads them again, so the markers in a URL are not styles.
  • CodeSpans: Code between backticks: the same number of backticks opens and closes it, so that a code can hold backticks.
  • Emphasis: The text styles. As in the original Markdown, *x* and _x_ are italic and **x** and __x__ are bold. --x-- and, as on GitHub, ~~x~~ are strikethrough, written as deleted text. ++x++ is underline, which Markdown does not have.
  • Escapes: A backslash before a punctuation character writes the character as it is.
  • InlineParser: Turns the text of a block into HTML: code spans, links, images, emphasis, line breaks, bare URLs.
  • LineBreaks: A hard line break: two spaces or more, or a backslash, at the end of a line.
  • Link: The parts of a link or of an image: its text, its URL, its title and its attributes.
  • Links: Links and images, written inline ([text](url "title")) or with a reference ([text][label], [label]).
  • RawHtml: The tags that are kept as they are, when the option asks for it: they are put aside so that nothing reads them.
  • SafeUrls: Tells whether a URL may be a link: a relative URL, or one whose scheme is allowed.
  • Lines: The lines of a text and the place that is being read.
  • Options: The settings of a conversion. The object is immutable: use the named arguments to change a setting.
  • References: The definitions of the reference links, written as "[label]: url "title"" on a line of their own.
  • Stash: HTML that is put aside while a text is read, so that nothing reads it again: each piece is replaced by a token, and the tokens are replaced by the pieces at the end.
  • Tag: The HTML element that writes a text style: its name and its CSS classes.

Documentation of 2.0.0 , built from f573e5f on 2.0.0 by pipeline #37507527063 on 2026-10-06.