"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useRemend = useRemend;
const tslib_1 = require("tslib");
const react_1 = require("react");
const remend_1 = tslib_1.__importDefault(require("remend"));
function useRemend(content, enabled) {
    return (0, react_1.useMemo)(() => {
        if (typeof content !== 'string' || content === '') {
            return '';
        }
        if (!enabled) {
            return content;
        }
        try {
            return (0, remend_1.default)(content.trim());
        }
        catch (_a) {
            return content;
        }
    }, [content, enabled]);
}
//# sourceMappingURL=useRemend.js.map
