mirror of
https://github.com/eigent-ai/eigent.git
synced 2026-04-29 12:10:24 +00:00
13 lines
419 B
JavaScript
13 lines
419 B
JavaScript
// src/utils/html.tsx
|
|
import { templateIdentity } from "./strings";
|
|
function escapeHtml(unsafe) {
|
|
return `${unsafe}`.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
}
|
|
function html(strings, ...values) {
|
|
return templateIdentity(strings, ...values.map((v) => escapeHtml(`${v}`)));
|
|
}
|
|
export {
|
|
escapeHtml,
|
|
html
|
|
};
|
|
//# sourceMappingURL=html.js.map
|