We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3e5840f commit 8d4313bCopy full SHA for 8d4313b
src/escapeHtml.ts
@@ -0,0 +1,3 @@
1
+export function escapeHtml(s: string): string {
2
+ return s.replace(/[&<>'"]/g, tag => ({ '&': '&', '<': '<', '>': '>', '\'': ''', '"': '"' }[tag] || tag))
3
+}
0 commit comments