Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.map(function (x) {
if (x.type === md.Syntax.Link) {
return extractText(x);
}
else if (x.type === md.Syntax.Image) {
// Images (at least on GitHub, untested elsewhere) are given a hyphen
// in the slug. We can achieve this behavior by adding an '*' to the
// TOC entry. Think of it as a "magic char" that represents the iamge.
return '*';
}
else {
return x.raw;
}
})
.join('')
.filter(function (x) {
return x.type === md.Syntax.Header;
})
.map(function (x) {
.filter(function(node) {
return node.type === md.Syntax.HtmlBlock || node.type === md.Syntax.Html;
})
.map(function (node) {