import { Parser } from "https://deno.land/x/html_parser@v0.1.3/src/Parser.ts";
Constructors
new
Parser(cbs: Partial<Handler> | null, options?: ParserOptions)Properties
private
readonly
cbs: Partial<Handler>private
readonly
options: ParserOptionsprivate
readonly
tokenizer: TokenizerMethods
private
closeCurrentTag()private
getInstructionName(value: string)private
updatePosition(initialOffset: number)deprecated
done(chunk?: string): voidAlias 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
onselfclosingtag(): void
ontext(data: string): void
deprecated
parseChunk(chunk: string): voidAlias 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.