mwbot-ts - v1.2.7
    Preparing search index...

    Interface Section

    Object that holds information about a section, parsed from wikitext.

    This object is returned by Wikitext.parseSections.

    interface Section {
        children: Set<number>;
        content: string;
        endIndex: number;
        heading: string;
        index: number;
        level: number;
        parent: null | number;
        startIndex: number;
        title: string;
        get text(): string;
    }
    Index

    Properties

    children: Set<number>

    The indices of the child Section objects within the parseSections result array.

    content: string

    The body content of the section, with leading and trailing whitespace preserved.

    endIndex: number

    The index up to, but not including, the end of the section in the wikitext.

    heading: string

    ==heading== or the outerHTML of a heading element, as directly parsed from the wikitext. This may include comment tags and a trailing newline.

    For the top section, the value is empty.

    index: number

    The index number of the section. This is the same as the section parameter of the edit API. For the top section, the value is 0.

    This property also matches the index of this Section object within the result array returned by parseSections.

    level: number

    The level of the section (1 to 6). For the top section, the value is 1.

    parent: null | number

    The index of the parent Section object within the parseSections result array, or null if there is no parent.

    startIndex: number

    The index to the start of the section in the wikitext.

    title: string

    The title of the section. Could be different from the result of action=parse if it contains HTML tags or templates. For the top section, the value is top.

    Accessors

    • get text(): string

      The full text of the section, including the heading.

      This is a getter that returns the concatenation of heading and content.

      Returns string