(s: string)
| 53 | } |
| 54 | |
| 55 | function decodeHtmlEntities(s: string): string { |
| 56 | return s.replace(/&#x([0-9A-Fa-f]+);/g, (_, hex) => String.fromCodePoint(parseInt(hex, 16))) |
| 57 | .replace(/&#(\d+);/g, (_, dec) => String.fromCodePoint(parseInt(dec, 10))); |
| 58 | } |
| 59 | |
| 60 | function parseKhalOutput(output: string): CalendarEvent[] { |
| 61 | const lines = output.trim().split("\n").filter(Boolean); |