An HTML parsing listener.

interface IHtmlParseListener {
    onEnd: (() => void);
    onTagClose: (() => void);
    onTagOpen: ((name, attributes) => void);
    onText: ((data) => void);
}

Properties

onEnd: (() => void)

Called when parsing has ended.

Type declaration

    • (): void
    • Returns void

onTagClose: (() => void)

Called when a tag is closed.

Type declaration

    • (): void
    • Returns void

onTagOpen: ((name, attributes) => void)

Called when a tag is opened.

Type declaration

    • (name, attributes): void
    • Parameters

      • name: string

        The tag name.

      • attributes: Record<string, string>

        A hash of attributes.

      Returns void

onText: ((data) => void)

Called when text contents are parsed. Note that this can be called multiple times per tag, when for example the string is spread over multiple chunks.

Type declaration

    • (data): void
    • Parameters

      • data: string

        A string.

      Returns void