MCPcopy
hub / github.com/laurent22/joplin / constructor

Method constructor

packages/fork-htmlparser2/src/Parser.ts:186–212  ·  view source on GitHub ↗
(cbs: Partial<Handler> | null, options?: ParserOptions)

Source from the content-addressed store, hash-verified

184 _tokenizer: Tokenizer;
185
186 constructor(cbs: Partial<Handler> | null, options?: ParserOptions) {
187 super();
188
189 this._options = options || {};
190 this._cbs = cbs || {};
191 this._tagname = "";
192 this._attribname = "";
193 this._attribvalue = "";
194 this._attribs = null;
195 this._stack = [];
196 this._foreignContext = [];
197 this.startIndex = 0;
198 this.endIndex = null;
199 this._lowerCaseTagNames =
200 "lowerCaseTags" in this._options
201 ? !!this._options.lowerCaseTags
202 : !this._options.xmlMode;
203 this._lowerCaseAttributeNames =
204 "lowerCaseAttributeNames" in this._options
205 ? !!this._options.lowerCaseAttributeNames
206 : !this._options.xmlMode;
207 this._tokenizer = new (this._options.Tokenizer || Tokenizer)(
208 this._options,
209 this
210 );
211 if (this._cbs.onparserinit) this._cbs.onparserinit(this);
212 }
213
214 _updatePosition(initialOffset: number) {
215 if (this.endIndex === null) {

Callers

nothing calls this directly

Calls 1

onparserinitMethod · 0.65

Tested by

no test coverage detected