Skip to content
FutureBlitz

    Install

    Import std.text.markdown

    MarkdownNode

    std.text.markdown

    class

    Public Class MarkdownNode

    A node of a document: a block, like a paragraph or a list, with the blocks, spans, and text in it; a span, like a link, with what's in it; or text.

    Examples

    Local document = ParseMarkdown("[home](https://futureblitz.dev)")
    Local link = document.Children[0].Children[0]
    Expect(link.Kind == MarkdownKind.Link && link.Url == "https://futureblitz.dev")
    Expect(link.PlainText() == "home")

    std/text/markdown.fb, line 127

    • Public Field Kind: MarkdownKind field #

      What kind of node it is.

    • Public Field Children: MarkdownNode[] field #

      What's in it, in order.

    • Public Field Text = "" field #

      A Text's or an Html's text, and a CodeBlock's, a Code's, or an HtmlBlock's, which have no children.

    • Public Field Level: Int field #

      A Heading's level, from 1 to 6.

    • Public Field Start: Int field #

      An OrderedList's first number.

    • Public Field Tight: Bool field #

      Whether a list is tight, with no blank lines between its items. Its items have no Paragraphs, in HTML or here: each holds its spans and text itself.

    • Public Field Task: Bool field #

      Whether a ListItem is a task, - [ ] to do, and whether it's done, - [x] done.

    • Public Field Done: Bool field #

      Whether a task ListItem is done.

    • Public Field Url = "" field #

      A Link's URL or an Image's source, and its title.

    • Public Field Title = "" field #

      A Link's or an Image's title.

    • Public Field Info = "" field #

      A CodeBlock's info string, like "rust ignore", and its language, the first word of it.

    • Public Field Language = "" field #

      A CodeBlock's language, the first word of its info string.

    • Public Field Alignment: MarkdownAlignment field #

      A TableHeaderCell's or TableCell's alignment.

    • Public New(kind: MarkdownKind) constructor #

      A new node of kind, with nothing in it.

    • Public Method PlainText(): String method #

      The text in it, without the markup: a heading's words, a link's, or an image's description, with a newline for each break. Each block in it, like a paragraph, a list item, or a table's row, is on lines of its own, and a row's cells are apart by a tab. A code block's text has no newline at its end, and raw HTML has none.

    Report an issue with this page or with FutureBlitz on GitHub.