packages/contracts/html.ts
Rama main · réplica de lectura del repositorio original.
const ESCAPES: Record<string, string> = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" };
/**
* 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]!);