Skip to main content
Module

x/mtkruto/deps.ts>Parser

Cross-runtime JavaScript library for building Telegram clients
Go to Latest
class Parser
Re-export
import { Parser } from "https://deno.land/x/mtkruto@0.0.835/deps.ts";

Constructors

new
Parser(cbs: Partial<Handler> | null, options?: ParserOptions)

Properties

private
attribname: string
private
attribs: null | { [key: string]: string; }
private
attribvalue: string
private
readonly
cbs: Partial<Handler>
private
readonly
foreignContext: boolean[]
private
readonly
lowerCaseAttributeNames: boolean
private
readonly
lowerCaseTagNames: boolean
private
readonly
options: ParserOptions
private
stack: string[]
private
tagname: string
private
readonly
tokenizer: Tokenizer
endIndex: number | null

The end index of the last event.

startIndex: number

The start index of the last event.

Methods

private
getInstructionName(value: string)
private
updatePosition(initialOffset: number)
deprecated
done(chunk?: string): void

Alias of end, for backwards compatibility.

end(chunk?: string): void

Parses the end of the buffer and clears the stack, calls onend.

isVoidElement(name: string): boolean
onattribdata(value: string): void
onattribend(quote: string | undefined | null): void
onattribname(name: string): void
oncdata(value: string): void
onclosetag(name: string): void
oncomment(value: string): void
ondeclaration(value: string): void
onend(): void
onerror(err: Error): void
onopentagend(): void
onopentagname(name: string): void
onprocessinginstruction(value: string): void
ontext(data: string): void
deprecated
parseChunk(chunk: string): void

Alias of write, for backwards compatibility.

parseComplete(data: string): void

Resets the parser, then parses a complete document and pushes it to the handler.

pause(): void

Pauses parsing. The parser won't emit events until resume is called.

reset(): void

Resets the parser to a blank state, ready to parse a new HTML document

resume(): void

Resumes parsing after pause was called.

write(chunk: string): void

Parses a chunk of data and calls the corresponding callbacks.