function parseText(parts, tag, h, param, continuationMarker, state) {
    var end = parts.length;
    if (!endTagRe.hasOwnProperty(tag.name)) {
      endTagRe[tag.name] = new RegExp('^' + tag.name + '(?:[\\s\\/]|$)', 'i');
    }
    var re = endTagRe[tag.name];
    var first = tag.next;
    var p = tag.next + 1;
    for (; p < end; p++) {
      if (parts[p - 1] === '<\/' && re.test(parts[p])) { break; }
    }
    if (p < end) { p -= 1; }
    var buf = parts.slice(first, p).join('');
    if (tag.eflags & html4.eflags.CDATA) {
      if (h.cdata) {
        h.cdata(buf, param, continuationMarker,
          continuationMaker(h, parts, p, state, param));
      }
    } else if (tag.eflags & html4.eflags.RCDATA) {
      if (h.rcdata) {
        h.rcdata(normalizeRCData(buf), param, continuationMarker,
          continuationMaker(h, parts, p, state, param));
      }
    } else {
      throw new Error('bug');
    }
    return p;
  }
// which means everything is text until we see the correct closing tag.
which means everything is text until we see the correct closing tag.
which means everything is text until we see the correct closing tag .
function parseText(parts, tag, h, param, continuationMarker, state) {
    var end = parts.length;
    if (!endTagRe.hasOwnProperty(tag.name)) {
      endTagRe[tag.name] = new RegExp('^' + tag.name + '(?:[\\s\\/]|$)', 'i');
    }
    var re = endTagRe[tag.name];
    var first = tag.next;
    var p = tag.next + 1;
    for (; p < end; p++) {
      if (parts[p - 1] === '<\/' && re.test(parts[p])) { break; }
    }
    if (p < end) { p -= 1; }
    var buf = parts.slice(first, p).join('');
    if (tag.eflags & html4.eflags.CDATA) {
      if (h.cdata) {
        h.cdata(buf, param, continuationMarker,
          continuationMaker(h, parts, p, state, param));
      }
    } else if (tag.eflags & html4.eflags.RCDATA) {
      if (h.rcdata) {
        h.rcdata(normalizeRCData(buf), param, continuationMarker,
          continuationMaker(h, parts, p, state, param));
      }
    } else {
      throw new Error('bug');
    }
    return p;
  }
function parseText ( parts , tag , h , param , continuationMarker , state ) { var end = parts . length ; if ( ! endTagRe . hasOwnProperty ( tag . name ) ) { endTagRe [ tag . name ] = new RegExp ( '^' + tag . name + '(?:[\\s\\/]|$)' , 'i' ) ; } var re = endTagRe [ tag . name ] ; var first = tag . next ; var p = tag . next + 1 ; for ( ; p < end ; p ++ ) { if ( parts [ p - 1 ] === '<\/' && re . test ( parts [ p ] ) ) { break ; } } if ( p < end ) { p -= 1 ; } var buf = parts . slice ( first , p ) . join ( '' ) ; if ( tag . eflags & html4 . eflags . CDATA ) { if ( h . cdata ) { h . cdata ( buf , param , continuationMarker , continuationMaker ( h , parts , p , state , param ) ) ; } } else if ( tag . eflags & html4 . eflags . RCDATA ) { if ( h . rcdata ) { h . rcdata ( normalizeRCData ( buf ) , param , continuationMarker , continuationMaker ( h , parts , p , state , param ) ) ; } } else { throw new Error ( 'bug' ) ; } return p ; }
which means everything is text until we see the correct closing tag.
which means everything is text until we see the correct closing tag .