Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function generateTocFromContent (node) {
return mdastToc(node, {
maxDepth: 6,
tight: true,
prefix: 'user-content-'
})
}
function transformer(node) {
const result = util(node, { heading, maxDepth: depth, tight });
if (result.index === null || result.index === -1 || !result.map) {
return;
}
node.children = [].concat(
node.children.slice(0, result.index),
result.map,
node.children.slice(result.index)
);
}
}
function transformer(node) {
const result = util(node, { heading: 'doctoc', maxDepth: 2 });
if (result.index === null || result.index === -1 || !result.map) {
node.children = [];
} else {
node.children = [result.map];
}
}
}
function transformer(node) {
const result = utiltoc(node, {
maxDepth: 4,
tight: false,
...options,
});
node.children = result.map ? [result.map] : [];
}
};