"use strict";
/**
 * @file markdown 解析
 */
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var highlight_js_1 = tslib_1.__importDefault(require("highlight.js"));
var markdown_it_1 = tslib_1.__importDefault(require("markdown-it"));
var utils_1 = require("markdown-it/lib/common/utils");
var markdown = markdown_it_1.default({
    linkify: true,
    highlight: function (str, lang) {
        if (lang && highlight_js_1.default.getLanguage(lang)) {
            try {
                return ('<pre class="hljs language-' +
                    utils_1.escapeHtml(lang.toLowerCase()) +
                    '"><code>' +
                    highlight_js_1.default.highlight(lang, str, true).value +
                    '</code></pre>');
            }
            catch (__) { }
        }
        return ('<pre class="hljs language-' +
            utils_1.escapeHtml(lang.toLowerCase()) +
            '"><code>' +
            utils_1.escapeHtml(str) +
            '</code></pre>');
    }
});
function default_1(content) {
    return markdown.render(content);
}
exports.default = default_1;
//# sourceMappingURL=./utils/markdown.js.map
