MCPcopy
hub / github.com/inikulin/parse5 / remove

Method remove

packages/parse5/lib/parser/open-element-stack.ts:210–224  ·  view source on GitHub ↗
(element: T['element'])

Source from the content-addressed store, hash-verified

208 }
209
210 remove(element: T['element']): void {
211 const idx = this._indexOf(element);
212
213 if (idx >= 0) {
214 if (idx === this.stackTop) {
215 this.pop();
216 } else {
217 this.items.splice(idx, 1);
218 this.tagIDs.splice(idx, 1);
219 this.stackTop--;
220 this._updateCurrentElement();
221 this.handler.onItemPop(element, false);
222 }
223 }
224 }
225
226 //Search
227 tryPeekProperlyNestedBodyElement(): T['element'] | null {

Callers 6

aaInnerLoopFunction · 0.80
startTagAfterHeadFunction · 0.80
aStartTagInBodyFunction · 0.80
formEndTagInBodyFunction · 0.80

Calls 4

_indexOfMethod · 0.95
popMethod · 0.95
_updateCurrentElementMethod · 0.95
onItemPopMethod · 0.80

Tested by

no test coverage detected