"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.markdownToHtmlHandler = markdownToHtmlHandler;
const utils_1 = require("../utils");
const transform_1 = __importDefault(require("@diplodoc/transform"));
function markdownToHtmlHandler(req, res) {
    try {
        const { text, allowHTML } = req.body;
        const result = (0, transform_1.default)(text, {
            disableLiquid: true,
            allowHTML,
            lang: 'en',
        });
        res.send(result);
    }
    catch (err) {
        (0, utils_1.sendAndLogError)(req.ctx, res, 500, err);
    }
}
