mirror of
https://github.com/tenrok/BBob.git
synced 2026-06-14 18:42:24 +03:00
13 lines
405 B
JavaScript
13 lines
405 B
JavaScript
const { isTagNode } = require('@bbob/plugin-helper');
|
|
const defaultProcessors = require('./default');
|
|
|
|
module.exports = function html5Preset(opts = {}) {
|
|
const processors = Object.assign({}, defaultProcessors, opts.processors || {});
|
|
|
|
return function process(tree, core) {
|
|
tree.walk(node => (isTagNode(node) && processors[node.tag]
|
|
? processors[node.tag](node, core)
|
|
: node));
|
|
};
|
|
};
|