Jacky Zhao
2024-02-24 c53fd5b56fb5a4a09df0a6dc8ff115b510f25d25
1
2
3
4
5
6
7
8
export const escapeHTML = (unsafe: string) => {
  return unsafe
    .replaceAll("&", "&")
    .replaceAll("<", "&lt;")
    .replaceAll(">", "&gt;")
    .replaceAll('"', "&quot;")
    .replaceAll("'", "&#039;")
}