UNPKG

@eaglesong/task-panorama

Version:
34 lines 1.48 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const esm_1 = require("@posthtml/esm"); const posthtml_1 = tslib_1.__importDefault(require("posthtml")); const posthtml_plugin_ban_text_nodes_1 = require("./posthtml-plugin-ban-text-nodes"); const posthtml_plugin_load_imports_1 = require("./posthtml-plugin-load-imports"); const posthtml_plugin_panorama_includes_1 = require("./posthtml-plugin-panorama-includes"); async function panoramaLayoutLoader(source, _map, meta) { var _a, _b; const callback = this.async(); const plugins = [ posthtml_plugin_panorama_includes_1.preserveIncludesBefore, esm_1.urls(), esm_1.imports(), posthtml_plugin_panorama_includes_1.preserveIncludesAfter, posthtml_plugin_load_imports_1.loadImports(this), posthtml_plugin_panorama_includes_1.validateIncludes(this), posthtml_plugin_ban_text_nodes_1.banTextNodes(this), ]; try { const input = ((_b = (_a = meta) === null || _a === void 0 ? void 0 : _a.ast) === null || _b === void 0 ? void 0 : _b.type) === 'posthtml' ? meta.ast.root : source; const { html } = await posthtml_1.default(plugins).process(input, { closingSingleTag: 'slash', xmlMode: true, }); callback(null, html); } catch (error) { callback(error); } } exports.default = panoramaLayoutLoader; //# sourceMappingURL=index.js.map