| 1 | /** Escapes text before embedding it in HTML or SVG attribute/value markup. */ |
| 2 | export const escapeHtml = (value: string): string => |
| 3 | value |
| 4 | .replace(/&/g, '&') |
| 5 | .replace(/</g, '<') |
| 6 | .replace(/>/g, '>') |
| 7 | .replace(/"/g, '"') |
| 8 | .replace(/'/g, ''') |
| 9 |