MCPcopy Create free account
hub / github.com/fb55/htmlparser2 / onprocessinginstruction

Method onprocessinginstruction

src/Parser.ts:643–654  ·  view source on GitHub ↗

* @param start Start index for the current parser event. * @param endIndex End index for the current parser event. * @internal

(start: number, endIndex: number)

Source from the content-addressed store, hash-verified

641 * @internal
642 */
643 onprocessinginstruction(start: number, endIndex: number): void {
644 this.endIndex = endIndex;
645 const value = this.getSlice(start, endIndex);
646
647 if (this.cbs.onprocessinginstruction) {
648 const name = this.getInstructionName(value);
649 this.cbs.onprocessinginstruction(`?${name}`, `?${value}`);
650 }
651
652 // Set `startIndex` for next node
653 this.startIndex = endIndex + 1;
654 }
655
656 /**
657 * @param start Start index for the current parser event.

Callers

nothing calls this directly

Calls 3

getSliceMethod · 0.95
getInstructionNameMethod · 0.95

Tested by

no test coverage detected