How to use the snapdragon-util.mapVisit 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
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);
  }

  util.mapVisit(ast, {recurse: true}, function(node) {
    if (node.type === 'br') {
      node.type = 'text';
      node.val = '';
    }
  });
}