import {visit} from 'unist-util-visit'; // This plugin is an example to let users write HTML with directives. // It’s informative but rather useless. // See below for others examples. /** @type {import('unified').Plugin<[], import('mdast').Root>} */ export default function specialBox() { return tree => { visit(tree, node => { if (node.type === 'containerDirective' && ( node.name === 'attention' || node.name === 'question' || node.name === 'information')) { const data = node.data || (node.data = {}); data.hName = 'div'; data.hProperties = { className: 'special-box ' + node.name, }; } }); }; }