How to use the snapdragon-util.visit function in snapdragon-util

To help you get started, we’ve selected a few snapdragon-util examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github breakdance / breakdance / lib / tables.js View on Github external
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);