MCPcopy Index your code
hub / github.com/fb55/htmlparser2 / reset

Method reset

src/Parser.ts:712–729  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

710 * Resets the parser to a blank state, ready to parse a new HTML document
711 */
712 reset(): void {
713 this.cbs.onreset?.();
714 this.tokenizer.reset();
715 this.tagname = "";
716 this.attribname = "";
717 this.attribvalue = "";
718 this.attribs = null;
719 this.stack.length = 0;
720 this.startIndex = 0;
721 this.endIndex = 0;
722 this.cbs.onparserinit?.(this);
723 this.buffers.length = 0;
724 this.foreignContext.length = 0;
725 this.foreignContext.unshift(ForeignContext.None);
726 this.bufferOffset = 0;
727 this.writeIndex = 0;
728 this.ended = false;
729 }
730
731 /**
732 * Resets the parser, then parses a complete document and

Callers 3

parseCompleteMethod · 0.95
Parser.spec.tsFile · 0.45
Tokenizer.spec.tsFile · 0.45

Calls 2

onresetMethod · 0.80
onparserinitMethod · 0.80

Tested by

no test coverage detected