code: function tfootNodes(ast) {
    var nodes = [];
    var tfoot;
  
    for (var i = 0; i < ast.nodes.length; i++) {
      var node = ast.nodes[i];
      if (node.type === 'tfoot') {
        tfoot = node.nodes;
      } else {
        nodes.push(node);
      }
    }
  
    if (tfoot) {
      var tbody = util.firstOfType(ast.nodes, 'tbody');
      if (tbody) {
        var len = tfoot.length;
        var idx = -1;
        while (++idx < len) {
          var tok = tfoot[idx];
          define(tok, 'parent', tbody);
          tbody.nodes.push(tok);
        }
      }
    }
  
    ast.nodes = nodes;
    return ast;
  }
docs: Add `thead` nodes if they don't exist