feat: add escapeHtml util

This commit is contained in:
p-sw 2024-06-02 08:14:18 +09:00
parent e7e7bfc395
commit a323bd3aa3

View File

@ -0,0 +1,3 @@
export const escapeHtml = (unsafe: string) => {
return unsafe.replaceAll('&', '&amp;').replaceAll('<', '&lt;').replaceAll('>', '&gt;').replaceAll('"', '&quot;').replaceAll("'", '&#039;');
}