Ctrl K
ComunidadGuías…

packages/contracts/html.ts

Rama main · réplica de lectura del repositorio original.

Archivo original ↗Preguntar a KiBot
const ESCAPES: Record<string, string> = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" };

/**
 * Text → HTML text or a quoted attribute value. The one escaper for the
 * server, the web app, the extension and the mail templates: & < > " '.
 */
export const escapeHtml = (value: string) => value.replace(/[&<>"']/g, (char) => ESCAPES[char]!);