Class Parser<T>

Type Parameters

Implements

Constructors

Properties

currentNotInHTML: boolean = false

Indicates that the current node is not an element in the HTML namespace

currentToken: null | Token.Token = null
document: T["document"]
options: Required<ParserOptions<T>>
stopped: boolean = false
tokenizer: Tokenizer
treeAdapter: TreeAdapter<T>

Methods

  • Protected

    Parameters

    • donor: T["parentNode"]
    • recipient: T["parentNode"]

    Returns void

  • Protected

    Returns { beforeElement: null | T["element"]; parent: T["parentNode"] }

  • Protected

    Parameters

    • element: T["element"]

    Returns void

  • Protected

    Parameters

    • tid: TAG_ID
    • element: T["element"]
    • OptionalforeignNS: NS

    Returns boolean

  • Protected

    Processes a given start tag.

    onStartTag checks if a self-closing tag was recognized. When a token is moved inbetween multiple insertion modes, this check for self-closing could lead to false positives. To avoid this, _processStartTag is used for nested calls.

    Parameters

    Returns void

  • Protected

    Returns void

  • Protected

    Parameters

    • selectIdx: number

    Returns void

  • Parameters

    • current: T["parentNode"]
    • tid: number

    Returns void

  • Protected

    Returns boolean

  • Protected

    Parameters

    • currentToken: TagToken
    • nextTokenizerState: DATA | RCDATA | RAWTEXT | SCRIPT_DATA | PLAINTEXT | CDATA_SECTION

    Returns void