validator/engine/htmlparser.js
/**
   * Callback for pcdata. Some text nodes can trigger the start of the body
   * region.
   * @param {string} text
   */
Callback for pcdata. Some text nodes can trigger the start of the body
region.
@param {string} text
Callback for pcdata . Some text nodes can trigger the start of the body region . @param { string } text
pcdata(text) {
    if (!amp.htmlparser.HtmlParser.SPACE_RE_.test(text)) {
      switch (this.region_) {
        case TagRegion.PRE_HEAD:
        case TagRegion.PRE_BODY:
          if (this.handler_.markManufacturedBody)
            this.handler_.markManufacturedBody();
          this.startTag('BODY', []);
          break;
        case TagRegion.IN_HEAD:
          this.endTag('HEAD');
          if (this.handler_.markManufacturedBody)
            this.handler_.markManufacturedBody();
          this.startTag('BODY', []);
          break;
        default:
          break;
      }
    }
    this.handler_.pcdata(text);
  }
pcdata ( text ) { if ( ! amp . htmlparser . HtmlParser . SPACE_RE_ . test ( text ) ) { switch ( this . region_ ) { case TagRegion . PRE_HEAD : case TagRegion . PRE_BODY : if ( this . handler_ . markManufacturedBody ) this . handler_ . markManufacturedBody ( ) ; this . startTag ( 'BODY' , [ ] ) ; break ; case TagRegion . IN_HEAD : this . endTag ( 'HEAD' ) ; if ( this . handler_ . markManufacturedBody ) this . handler_ . markManufacturedBody ( ) ; this . startTag ( 'BODY' , [ ] ) ; break ; default : break ; } } this . handler_ . pcdata ( text ) ; }
Callback for pcdata.
Callback for pcdata .