Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function tableize(ast) {
util.visit(ast, {recurse: true}, function(node) {
if (node.type === 'text') {
node.val = node.val.trim();
}
return node;
});
if (!util.hasType(ast, 'thead')) {
createHead(ast);
}
combineRows(ast);
if (!util.hasType(ast, 'tbody')) {
createBody(ast);
}
if (util.hasType(ast, 'tfoot')) {
tfootNodes(ast);