"use strict"; const highlight = require("highlight.js"); const Markdown = require("markdown-it"); const markdownOptions = { html: true, typographer: true, highlight: function(str, lang) { if (lang && highlight.getLanguage(lang)) { try { return ` ${highlight.highlight(lang, str).value}`; } catch (error) { console.error("highlighting failed", error); } } return ""; } }; const markdown = new Markdown(markdownOptions); module.exports = markdown.render.bind(markdown);