UNPKG

webforai

Version:

A library that provides a web interface for AI

38 lines (37 loc) 1.57 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var custom_table_handler_exports = {}; __export(custom_table_handler_exports, { customTableHandler: () => customTableHandler }); module.exports = __toCommonJS(custom_table_handler_exports); var import_hast_util_to_mdast = require("hast-util-to-mdast"); var import_hast_util_to_text = require("hast-util-to-text"); const customTableHandler = (options) => (state, node) => { if (options?.asText) { const paragraph = { type: "paragraph", children: [{ type: "text", value: (0, import_hast_util_to_text.toText)(node) }] }; state.patch(node, paragraph); return paragraph; } return import_hast_util_to_mdast.defaultHandlers.table(state, node); }; // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { customTableHandler });