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