code: function startTagInCaption(p, token) {
      const tn = token.tagName;
  
      if (
          tn === $.CAPTION ||
          tn === $.COL ||
          tn === $.COLGROUP ||
          tn === $.TBODY ||
          tn === $.TD ||
          tn === $.TFOOT ||
          tn === $.TH ||
          tn === $.THEAD ||
          tn === $.TR
      ) {
          if (p.openElements.hasInTableScope($.CAPTION)) {
              p.openElements.generateImpliedEndTags();
              p.openElements.popUntilTagNamePopped($.CAPTION);
              p.activeFormattingElements.clearToLastMarker();
              p.insertionMode = IN_TABLE_MODE;
              p._processToken(token);
          }
      } else {
          startTagInBody(p, token);
      }
  }
docs: The "in caption" insertion mode ------------------------------------------------------------------