myst-parser
Version:
Markdown parser for MyST markdown in JavaScript
10 lines (9 loc) • 427 B
JavaScript
import { dollarmathPlugin } from 'markdown-it-dollarmath';
import { amsmathPlugin } from 'markdown-it-amsmath';
export function plugin(md, options) {
const opts = options === true ? { amsmath: true, dollarmath: true } : options;
if (opts === null || opts === void 0 ? void 0 : opts.dollarmath)
dollarmathPlugin(md);
if (opts === null || opts === void 0 ? void 0 : opts.amsmath)
amsmathPlugin(md);
}