@vivliostyle/vfm
Version:
Custom Markdown syntax specialized in book authoring.
38 lines (37 loc) • 1.22 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.reviveRehype = void 0;
var rehype_raw_1 = __importDefault(require("rehype-raw"));
var remark_rehype_1 = __importDefault(require("remark-rehype"));
var code_1 = require("./plugins/code");
var figure_1 = require("./plugins/figure");
var footnotes_1 = require("./plugins/footnotes");
var math_1 = require("./plugins/math");
var ruby_1 = require("./plugins/ruby");
var utils_1 = require("./utils");
/**
* Create Hypertext AST handlers and transformers.
* @param enableMath Enable math syntax.
* @returns Handlers and transformers.
*/
exports.reviveRehype = [
[
remark_rehype_1.default,
{
allowDangerousHtml: true,
handlers: {
displayMath: math_1.handlerDisplayMath,
inlineMath: math_1.handlerInlineMath,
ruby: ruby_1.handler,
code: code_1.handler,
},
},
],
rehype_raw_1.default,
figure_1.hast,
footnotes_1.hast,
(0, utils_1.inspect)('hast'),
];