"use strict";Object.defineProperty(exports, "__esModule", { value: true });exports.MDAST = exports.stringifyMarkdown = exports.stringifyHtml = exports.parseMarkdown = void 0;var _unified = _interopRequireDefault(require("unified"));

var _remarkParse = _interopRequireDefault(require("remark-parse"));
var _remarkMath = _interopRequireDefault(require("remark-math"));
var _remarkHighlight = _interopRequireDefault(require("remark-highlight.js"));
var _remarkBreaks = _interopRequireDefault(require("remark-breaks"));
var _remarkHtmlKatex = _interopRequireDefault(require("remark-html-katex"));
var _remarkHtml = _interopRequireDefault(require("remark-html"));
var _remarkFrontmatter = _interopRequireDefault(require("remark-frontmatter"));
var _remarkStringify = _interopRequireDefault(require("remark-stringify"));

var MDAST = _interopRequireWildcard(require("./mdast"));exports.MDAST = MDAST;function _interopRequireWildcard(obj) {if (obj && obj.__esModule) {return obj;} else {var newObj = {};if (obj != null) {for (var key in obj) {if (Object.prototype.hasOwnProperty.call(obj, key)) {var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};if (desc.get || desc.set) {Object.defineProperty(newObj, key, desc);} else {newObj[key] = obj[key];}}}}newObj.default = obj;return newObj;}}function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}


const markdown = (0, _unified.default)().
use(_remarkParse.default).
use(_remarkBreaks.default).
use(_remarkMath.default).
use(_remarkHtmlKatex.default).
use(_remarkHighlight.default).
use(_remarkFrontmatter.default, ['yaml']).
use(_remarkStringify.default);

const parseMarkdown = vfile => {
  return markdown.parse(vfile);
};exports.parseMarkdown = parseMarkdown;

const stringifyHtml = (node, vfile) =>
(0, _unified.default)().
use(_remarkHtml.default).
stringify(node, vfile);exports.stringifyHtml = stringifyHtml;

const stringifyMarkdown = (node, vfile) =>
markdown.stringify(node, vfile);exports.stringifyMarkdown = stringifyMarkdown;