stateInCommentLike(c) {
        if (c === this.currentSequence[this.sequenceIndex]) {
            if (++this.sequenceIndex === this.currentSequence.length) {
                if (this.currentSequence === Sequences.CdataEnd) {
                    this.cbs.oncdata(this.sectionStart, this.index, 2);
                }
                else {
                    this.cbs.oncomment(this.sectionStart, this.index, 2);
                }
                this.sequenceIndex = 0;
                this.sectionStart = this.index + 1;
                this.state = State.Text;
            }
        }
        else if (this.sequenceIndex === 0) {
            // Fast-forward to the first character of the sequence
            if (this.fastForwardTo(this.currentSequence[0])) {
                this.sequenceIndex = 1;
            }
        }
        else if (c !== this.currentSequence[this.sequenceIndex - 1]) {
            // Allow long sequences, eg. --->, ]]]>
            this.sequenceIndex = 0;
        }
    }
/**
     * Comments and CDATA end with `-->` and `]]>`.
     *
     * Their common qualities are:
     * - Their end sequences have a distinct character they start with.
     * - That character is then repeated, so we have to check multiple repeats.
     * - All characters but the start character of the sequence can be skipped.
     */
Comments and CDATA end with `-->` and `]]>`.
Their common qualities are:
- Their end sequences have a distinct character they start with.
- That character is then repeated, so we have to check multiple repeats.
- All characters but the start character of the sequence can be skipped.
Comments and CDATA end with ` -- > ` and ` ]] > ` . Their common qualities are : - Their end sequences have a distinct character they start with . - That character is then repeated so we have to check multiple repeats . - All characters but the start character of the sequence can be skipped .
stateInCommentLike(c) {
        if (c === this.currentSequence[this.sequenceIndex]) {
            if (++this.sequenceIndex === this.currentSequence.length) {
                if (this.currentSequence === Sequences.CdataEnd) {
                    this.cbs.oncdata(this.sectionStart, this.index, 2);
                }
                else {
                    this.cbs.oncomment(this.sectionStart, this.index, 2);
                }
                this.sequenceIndex = 0;
                this.sectionStart = this.index + 1;
                this.state = State.Text;
            }
        }
        else if (this.sequenceIndex === 0) {
            if (this.fastForwardTo(this.currentSequence[0])) {
                this.sequenceIndex = 1;
            }
        }
        else if (c !== this.currentSequence[this.sequenceIndex - 1]) {
            this.sequenceIndex = 0;
        }
    }
stateInCommentLike ( c ) { if ( c === this . currentSequence [ this . sequenceIndex ] ) { if ( ++ this . sequenceIndex === this . currentSequence . length ) { if ( this . currentSequence === Sequences . CdataEnd ) { this . cbs . oncdata ( this . sectionStart , this . index , 2 ) ; } else { this . cbs . oncomment ( this . sectionStart , this . index , 2 ) ; } this . sequenceIndex = 0 ; this . sectionStart = this . index + 1 ; this . state = State . Text ; } } else if ( this . sequenceIndex === 0 ) { if ( this . fastForwardTo ( this . currentSequence [ 0 ] ) ) { this . sequenceIndex = 1 ; } } else if ( c !== this . currentSequence [ this . sequenceIndex - 1 ] ) { this . sequenceIndex = 0 ; } }
Comments and CDATA end with `-->` and `]]>`.
Comments and CDATA end with ` -- > ` and ` ]] > ` .
// Fast-forward to the first character of the sequence // Allow long sequences, eg. --->, ]]]>