Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return function(node, nodes, i) {
if (util.isEmptyNodes(node, open)) return;
var state = this.state;
var type = node.type;
var isVoid = isSelfClosing(node.type);
if (!isVoid && !this.compilers.hasOwnProperty(type + '.open')) {
this.set(type + '.open', util.noop);
this.set(type + '.close', util.noop);
}
// convert headings to bold see: edge-cases.md - headings #1
if (/^h[1-6]$/.test(type)) {
if (util.isInside(state, node, ['a', 'li', 'table'])) {
node.type = 'strong';
open = '**';
close = '**';
}
}
if (typeof visitor === 'function') {
visitor.call(this, node, nodes, i);
// allow visitor to override opening tag
if (node.open) {
open = node.open;
}
}
if (!/^(sup|sub)$/.test(node.type) && /[a-z0-9]/i.test(this.output.slice(-1))) {
compiler.isInside = function(node, types) {
return util.isInside(this.state, node, types);
};