function htmlSplit(str) {
    // can't hoist this out of the function because of the re.exec loop.
    var re = /(<\/|<\!--|<[!?]|[&<>])/g;
    str += '';
    if (splitWillCapture) {
      return str.split(re);
    } else {
      var parts = [];
      var lastPos = 0;
      var m;
      while ((m = re.exec(str)) !== null) {
        parts.push(str.substring(lastPos, m.index));
        parts.push(m[0]);
        lastPos = m.index + m[0].length;
      }
      parts.push(str.substring(lastPos));
      return parts;
    }
  }
function htmlSplit(str) {
    // can't hoist this out of the function because of the re.exec loop.
    var re = /(<\/|<\!--|<[!?]|[&<>])/g;
    str += '';
    if (splitWillCapture) {
      return str.split(re);
    } else {
      var parts = [];
      var lastPos = 0;
      var m;
      while ((m = re.exec(str)) !== null) {
        parts.push(str.substring(lastPos, m.index));
        parts.push(m[0]);
        lastPos = m.index + m[0].length;
      }
      parts.push(str.substring(lastPos));
      return parts;
    }
  }
function htmlSplit ( str ) { // can't hoist this out of the function because of the re.exec loop. var re = / (<\/|<\!--|<[!?]|[&<>]) / g ; str += '' ; if ( splitWillCapture ) { return str . split ( re ) ; } else { var parts = [ ] ; var lastPos = 0 ; var m ; while ( ( m = re . exec ( str ) ) !== null ) { parts . push ( str . substring ( lastPos , m . index ) ) ; parts . push ( m [ 0 ] ) ; lastPos = m . index + m [ 0 ] . length ; } parts . push ( str . substring ( lastPos ) ) ; return parts ; } }
Split str into parts for the html parser.
Split str into parts for the html parser .
split the string into an array of parts