stateInSpecialTag(c) {
        if (this.sequenceIndex === this.currentSequence.length) {
            if (c === CharCodes.Gt || isWhitespace(c)) {
                const endOfText = this.index - this.currentSequence.length;
                if (this.sectionStart < endOfText) {
                    // Spoof the index so that reported locations match up.
                    const actualIndex = this.index;
                    this.index = endOfText;
                    this.cbs.ontext(this.sectionStart, endOfText);
                    this.index = actualIndex;
                }
                this.isSpecial = false;
                this.sectionStart = endOfText + 2; // Skip over the `</`
                this.stateInClosingTagName(c);
                return; // We are done; skip the rest of the function.
            }
            this.sequenceIndex = 0;
        }
        if ((c | 0x20) === this.currentSequence[this.sequenceIndex]) {
            this.sequenceIndex += 1;
        }
        else if (this.sequenceIndex === 0) {
            if (this.currentSequence === Sequences.TitleEnd) {
                // We have to parse entities in <title> tags.
                if (this.decodeEntities && c === CharCodes.Amp) {
                    this.state = State.BeforeEntity;
                }
            }
            else if (this.fastForwardTo(CharCodes.Lt)) {
                // Outside of <title> tags, we can fast-forward.
                this.sequenceIndex = 1;
            }
        }
        else {
            // If we see a `<`, set the sequence index to 1; useful for eg. `<</script>`.
            this.sequenceIndex = Number(c === CharCodes.Lt);
        }
    }
/** Look for an end tag. For <title> tags, also decode entities. */
Look for an end tag. For  tags, also decode entities.
Look for an end tag . For tags also decode entities .
stateInSpecialTag(c) {
        if (this.sequenceIndex === this.currentSequence.length) {
            if (c === CharCodes.Gt || isWhitespace(c)) {
                const endOfText = this.index - this.currentSequence.length;
                if (this.sectionStart < endOfText) {
                    const actualIndex = this.index;
                    this.index = endOfText;
                    this.cbs.ontext(this.sectionStart, endOfText);
                    this.index = actualIndex;
                }
                this.isSpecial = false;
                this.sectionStart = endOfText + 2; 
                this.stateInClosingTagName(c);
                return; 
            }
            this.sequenceIndex = 0;
        }
        if ((c | 0x20) === this.currentSequence[this.sequenceIndex]) {
            this.sequenceIndex += 1;
        }
        else if (this.sequenceIndex === 0) {
            if (this.currentSequence === Sequences.TitleEnd) {
                if (this.decodeEntities && c === CharCodes.Amp) {
                    this.state = State.BeforeEntity;
                }
            }
            else if (this.fastForwardTo(CharCodes.Lt)) {
                this.sequenceIndex = 1;
            }
        }
        else {
            this.sequenceIndex = Number(c === CharCodes.Lt);
        }
    }
stateInSpecialTag ( c ) { if ( this . sequenceIndex === this . currentSequence . length ) { if ( c === CharCodes . Gt || isWhitespace ( c ) ) { const endOfText = this . index - this . currentSequence . length ; if ( this . sectionStart < endOfText ) { const actualIndex = this . index ; this . index = endOfText ; this . cbs . ontext ( this . sectionStart , endOfText ) ; this . index = actualIndex ; } this . isSpecial = false ; this . sectionStart = endOfText + 2 ; this . stateInClosingTagName ( c ) ; return ; } this . sequenceIndex = 0 ; } if ( ( c | 0x20 ) === this . currentSequence [ this . sequenceIndex ] ) { this . sequenceIndex += 1 ; } else if ( this . sequenceIndex === 0 ) { if ( this . currentSequence === Sequences . TitleEnd ) { if ( this . decodeEntities && c === CharCodes . Amp ) { this . state = State . BeforeEntity ; } } else if ( this . fastForwardTo ( CharCodes . Lt ) ) { this . sequenceIndex = 1 ; } } else { this . sequenceIndex = Number ( c === CharCodes . Lt ) ; } }
Look for an end tag.
Look for an end tag .
// Spoof the index so that reported locations match up. // Skip over the `</` // We are done; skip the rest of the function. // We have to parse entities in <title> tags. // Outside of <title> tags, we can fast-forward. // If we see a `<`, set the sequence index to 1; useful for eg. `<</script>`.