util: escapeHtml

This commit is contained in:
CrescentLeaf
2025-11-09 16:01:53 +08:00
parent a7df2c689a
commit 19b2fce904

5
client/escapeHtml.ts Normal file
View File

@@ -0,0 +1,5 @@
export default function escapeHTML(str: string) {
const div = document.createElement('div')
div.textContent = str
return div.innerHTML
}