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

Method constructor

src/Parser.ts:291–308  ·  view source on GitHub ↗
(
        cbs?: Partial<Handler> | null,
        private readonly options: ParserOptions = {},
    )

Source from the content-addressed store, hash-verified

289 private ended = false;
290
291 constructor(
292 cbs?: Partial<Handler> | null,
293 private readonly options: ParserOptions = {},
294 ) {
295 this.cbs = cbs ?? {};
296 this.htmlMode = !this.options.xmlMode;
297 this.lowerCaseTagNames = options.lowerCaseTags ?? this.htmlMode;
298 this.lowerCaseAttributeNames =
299 options.lowerCaseAttributeNames ?? this.htmlMode;
300 this.recognizeSelfClosing =
301 options.recognizeSelfClosing ?? !this.htmlMode;
302 this.tokenizer = new (options.Tokenizer ?? Tokenizer)(
303 this.options,
304 this,
305 );
306 this.foreignContext = [ForeignContext.None];
307 this.cbs.onparserinit?.(this);
308 }
309
310 // Tokenizer event handlers
311

Callers

nothing calls this directly

Calls 1

onparserinitMethod · 0.80

Tested by

no test coverage detected