json-joy
Version:
Collection of libraries for building collaborative editing apps.
15 lines (14 loc) • 596 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.toMarkdown = exports.toMdast = void 0;
const export_html_1 = require("./export-html");
const toMdast_1 = require("very-small-parser/lib/html/toMdast");
const toText_1 = require("very-small-parser/lib/markdown/block/toText");
const toMdast = (json) => {
const hast = (0, export_html_1.toHast)(json);
const mdast = (0, toMdast_1.toMdast)(hast);
return mdast;
};
exports.toMdast = toMdast;
const toMarkdown = (json) => (0, toText_1.toText)((0, exports.toMdast)(json));
exports.toMarkdown = toMarkdown;
;