export const escapeHtml = (s: string): string => s.replace(PATTERN, escaped); const PATTERN = /[&<>'"]/g; const escaped = (c: string) => c === "&" ? "&" : c === "<" ? "<" : c === ">" ? ">" : c === "'" ? "'" : """;