escapeHtml

tcmts.cli.web.escapeHtml · #5m4tadqy · term · runs anywhere

export const escapeHtml = (s: string) => s.replace(/[&<>]/g, (c) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;" })[c]!)

used by