lib/HTMLParser.js
function in_head_noscript_mode(t, value, arg3, arg4) {
    switch(t) {
    case 5: // DOCTYPE
      return;
    case 4: // COMMENT
      in_head_mode(t, value);
      return;
    case 1: // TEXT
      var ws = value.match(LEADINGWS);
      if (ws) {
        in_head_mode(t, ws[0]);
        value = value.substring(ws[0].length);
      }
      if (value.length === 0) return; // no more text
      break; // Handle non-whitespace below
    case 2: // TAG
      switch(value) {
      case "html":
        in_body_mode(t, value, arg3, arg4);
        return;
      case "basefont":
      case "bgsound":
      case "link":
      case "meta":
      case "noframes":
      case "style":
        in_head_mode(t, value, arg3);
        return;
      case "head":
      case "noscript":
        return;
      }
      break;
    case 3: // ENDTAG
      switch(value) {
      case "noscript":
        stack.pop();
        parser = in_head_mode;
        return;
      case "br":
        break;  // goes to the outer default
      default:
        return; // ignore other end tags
      }
      break;
    }

    // If not handled above
    in_head_noscript_mode(ENDTAG, "noscript", null);
    parser(t, value, arg3, arg4);
  }
function in_head_noscript_mode(t, value, arg3, arg4) {
    switch(t) {
    case 5: // DOCTYPE
      return;
    case 4: // COMMENT
      in_head_mode(t, value);
      return;
    case 1: // TEXT
      var ws = value.match(LEADINGWS);
      if (ws) {
        in_head_mode(t, ws[0]);
        value = value.substring(ws[0].length);
      }
      if (value.length === 0) return; // no more text
      break; // Handle non-whitespace below
    case 2: // TAG
      switch(value) {
      case "html":
        in_body_mode(t, value, arg3, arg4);
        return;
      case "basefont":
      case "bgsound":
      case "link":
      case "meta":
      case "noframes":
      case "style":
        in_head_mode(t, value, arg3);
        return;
      case "head":
      case "noscript":
        return;
      }
      break;
    case 3: // ENDTAG
      switch(value) {
      case "noscript":
        stack.pop();
        parser = in_head_mode;
        return;
      case "br":
        break;  // goes to the outer default
      default:
        return; // ignore other end tags
      }
      break;
    }

    // If not handled above
    in_head_noscript_mode(ENDTAG, "noscript", null);
    parser(t, value, arg3, arg4);
  }
function in_head_noscript_mode ( t , value , arg3 , arg4 ) { switch ( t ) { case 5 : // DOCTYPE return ; case 4 : // COMMENT in_head_mode ( t , value ) ; return ; case 1 : // TEXT var ws = value . match ( LEADINGWS ) ; if ( ws ) { in_head_mode ( t , ws [ 0 ] ) ; value = value . substring ( ws [ 0 ] . length ) ; } if ( value . length === 0 ) return ; // no more text break ; // Handle non-whitespace below case 2 : // TAG switch ( value ) { case "html" : in_body_mode ( t , value , arg3 , arg4 ) ; return ; case "basefont" : case "bgsound" : case "link" : case "meta" : case "noframes" : case "style" : in_head_mode ( t , value , arg3 ) ; return ; case "head" : case "noscript" : return ; } break ; case 3 : // ENDTAG switch ( value ) { case "noscript" : stack . pop ( ) ; parser = in_head_mode ; return ; case "br" : break ; // goes to the outer default default : return ; // ignore other end tags } break ; } // If not handled above in_head_noscript_mode ( ENDTAG , "noscript" , null ) ; parser ( t , value , arg3 , arg4 ) ; }
13.2.5.4.5 The "in head noscript" insertion mode
13 . 2 . 5 . 4 . 5 The in head noscript insertion mode