json-joy
Version:
Collection of libraries for building collaborative editing apps.
10 lines (9 loc) • 384 B
JavaScript
import { toHast } from './export-html';
import { toMdast as _toMdast } from 'very-small-parser/lib/html/toMdast';
import { toText as _toMarkdown } from 'very-small-parser/lib/markdown/block/toText';
export const toMdast = (json) => {
const hast = toHast(json);
const mdast = _toMdast(hast);
return mdast;
};
export const toMarkdown = (json) => _toMarkdown(toMdast(json));