markdown-it - v15.0.2
    Preparing search index...

    Interface Token

    Represents one item in the parsed token stream, storing parsed data and providing helpers for managing HTML attributes.

    interface Token {
        type: string;
        tag: string;
        attrs: [name: string, value: string | number][] | null;
        map: [number, number] | null;
        nesting: 0 | 1 | -1;
        level: number;
        children: Token[] | null;
        content: string;
        markup: string;
        info: string;
        meta: Record<string, unknown> | null;
        block: boolean;
        hidden: boolean;
        attrIndex(name: string): number;
        attrPush(attrData: [name: string, value: string | number]): void;
        attrSet(name: string, value: string | number): void;
        attrGet(name: string): string | number | null;
        attrJoin(name: string, value: string | number): void;
    }
    Index

    Type of the token (string, e.g. "paragraph_open")

    html tag name, e.g. "p"

    Html attributes. Format: [ [ name1, value1 ], [ name2, value2 ] ]

    Source map info. Format: [ line_begin, line_end ]

    Level change (number in {-1, 0, 1} set), where:

    • 1 means the tag is opening
    • 0 means the tag is self-closing
    • -1 means the tag is closing

    nesting level, the same as state.level

    An array of child nodes (inline and img tokens)

    In a case of self-closing tag (code, html, fence, etc.), it has contents of this tag.

    '*' or '_' for emphasis, fence string for fence, etc.

    Additional information:

    • Info string for "fence" tokens
    • The value "auto" for autolink "link_open" and "link_close" tokens
    • The string value of the item marker for ordered-list "list_item_open" tokens

    A place for plugins to store an arbitrary data

    True for block-level tokens, false for inline tokens. Used in renderer to calculate line breaks

    If it's true, ignore this element when rendering. Used for tight lists to hide paragraphs.

    • Search attribute index by name.

      Parameters

      • name: string

      Returns number

    • Add [ name, value ] attribute to list. Init attrs if necessary

      Parameters

      • attrData: [name: string, value: string | number]

      Returns void

    • Set name attribute to value. Override old value if exists.

      Parameters

      • name: string
      • value: string | number

      Returns void

    • Get the value of attribute name, or null if it does not exist.

      Parameters

      • name: string

      Returns string | number | null

    • Join value to existing attribute via space. Or create new attribute if not exists. Useful to operate with token classes.

      Parameters

      • name: string
      • value: string | number

      Returns void