(text: string)
| 83 | * @returns The unescaped string with HTML entities converted to their literal characters |
| 84 | */ |
| 85 | export function unescapeHtmlEntities(text: string): string { |
| 86 | if (!text) return text |
| 87 | |
| 88 | return text |
| 89 | .replace(/</g, "<") |
| 90 | .replace(/>/g, ">") |
| 91 | .replace(/"/g, '"') |
| 92 | .replace(/'/g, "'") |
| 93 | .replace(/'/g, "'") |
| 94 | .replace(/[/g, "[") |
| 95 | .replace(/]/g, "]") |
| 96 | .replace(/[/g, "[") |
| 97 | .replace(/]/g, "]") |
| 98 | .replace(/&/g, "&") |
| 99 | } |
no test coverage detected