yamp
Version:
Yet Another Markdown Parser
17 lines (15 loc) • 386 B
JavaScript
;
/*
TOC Parser
==========
Inserts table of contents
*/
const toc = require('markdown-toc');
module.exports = function(content, linkify, done) {
let parsedContent = toc.insert(content, {
linkify: linkify
});
let err = null;
if (content && !parsedContent) err = new Error("Toc Parser - No content generated");
return done(err, parsedContent);
};