"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.markdownToHtml = void 0;
const marked_1 = require("marked");
const sanitize_html_1 = __importDefault(require("sanitize-html"));
const markdownToHtml = async (str) => {
    try {
        const htmlOutput = await (0, marked_1.marked)(str);
        const sanitizedHtmlOutput = (0, sanitize_html_1.default)(htmlOutput);
        return sanitizedHtmlOutput.trim();
    }
    catch (_a) {
        throw new Error('Unable to parse markdown string to HTML');
    }
};
exports.markdownToHtml = markdownToHtml;
//# sourceMappingURL=markdownToHtml.js.map