(html: string)
| 7 | }; |
| 8 | |
| 9 | export function escapeHtml(html: string): string { |
| 10 | return html.replace(/[&<"]/g, (m) => escapeChars[m]); |
| 11 | } |
| 12 | |
| 13 | export function escapeScript(content: string): string { |
| 14 | return content.replace(/<(\/script>)/g, '\\x3c$2'); |