Skip to content

Instantly share code, notes, and snippets.

@ddbeck
Created June 26, 2019 16:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ddbeck/f6ae317aa3d36786286724fffe7a283b to your computer and use it in GitHub Desktop.
Save ddbeck/f6ae317aa3d36786286724fffe7a283b to your computer and use it in GitHub Desktop.
const visit = require('unist-util-visit')
function transformer(tree, file) {
visit(tree, 'element', (node, index, parent) => {
if (node.tagName === 'div' && node.properties.className && node.properties.className.includes('bc-data')) {
parent.children.splice(index, 1);
}
});
}
module.exports = () => transformer;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment