keroosha.cybergulag.today/quartz/util/escape.ts

9 lines
216 B
TypeScript
Raw Permalink Normal View History

2023-09-07 07:47:59 +03:00
export const escapeHTML = (unsafe: string) => {
return unsafe
.replaceAll("&", "&")
.replaceAll("<", "&lt;")
.replaceAll(">", "&gt;")
.replaceAll('"', "&quot;")
.replaceAll("'", "&#039;")
}