quran-md-plugin / node_modules /hono /dist /jsx /jsx-runtime.js
Z User
phase7: MCP stdio smoke test (handshake + tools/list + get_roots 6:74) — 4/4 tests PASS
54a6341
Raw History Blame Contribute Delete
1.2 kB
import { escapeToBuffer, raw, stringBufferToString } from "../utils/html.js";
import { html } from "../helper/html/index.js";
import { PERMALINK } from "./constants.js";
import { isValidAttributeName } from "./utils.js";
import { Fragment, attributeToBuffer, markRenderedJSX } from "./base.js";
import { jsxDEV } from "./jsx-dev-runtime.js";
//#region src/jsx/jsx-runtime.ts
const jsxTemplate = (strings, ...values) => {
const result = html(strings, ...values);
return result instanceof Promise ? result.then(markRenderedJSX) : markRenderedJSX(result);
};
const jsxAttr = (key, v) => {
if (!isValidAttributeName(key)) return raw("");
if (typeof v === "string") {
const buffer = [`${key}="`];
escapeToBuffer(v, buffer);
return raw(buffer[0] + "\"");
}
let value = v;
if (typeof value === "function" && (key === "action" || key === "formaction")) value = PERMALINK in value ? value[PERMALINK] : void 0;
const buffer = [""];
attributeToBuffer(buffer, "", key, value);
return buffer.length === 1 ? raw(buffer[0]) : stringBufferToString(buffer, void 0);
};
const jsxEscape = (value) => value;
//#endregion
export { Fragment, jsxDEV as jsx, jsxAttr, jsxEscape, jsxTemplate, jsxDEV as jsxs };