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 = 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"];
    }

    • beforeElement: null | T["element"]
    • parent: T["parentNode"]
  • Protected

    Parameters

    • element: T["element"]

    Returns void

  • Protected

    Parameters

    Returns void

  • Protected

    Parameters

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

    Returns boolean

  • Protected

    Parameters

    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

    Parameters

    • element: T["element"]
    • closingToken: Token

    Returns void

  • Protected

    Returns boolean

  • Protected

    Parameters

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

    Returns void

  • Type Parameters

    • T extends TreeAdapterTypeMap<unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown>

    Parameters

    Returns T["document"]