ForcePilot/web/src/utils/html.js

8 lines
208 B
JavaScript
Raw Normal View History

2026-05-08 01:04:23 +08:00
export const escapeHtml = (value) =>
String(value ?? '')
.replaceAll('&', '&')
.replaceAll('<', '&lt;')
.replaceAll('>', '&gt;')
.replaceAll('"', '&quot;')
.replaceAll("'", '&#39;')