diff --git a/public/utils/html.js b/public/utils/html.js
index e825041..683c947 100644
--- a/public/utils/html.js
+++ b/public/utils/html.js
@@ -25,3 +25,25 @@ export function esc(str) {
if (str == null) return '';
return String(str).replace(ESCAPE_RE, (ch) => ESCAPE_MAP[ch]);
}
+
+/**
+ * Normalisiert einen iCalendar LOCATION-String fuer die Anzeige.
+ * Entfernt ICS-Backslash-Escapes (RFC 5545 §3.3.11) und fasst
+ * mehrzeilige Adressen zu einem einzeiligen String zusammen.
+ *
+ * @param {string|null|undefined} raw
+ * @returns {string}
+ */
+export function fmtLocation(raw) {
+ if (!raw) return '';
+ return raw
+ .replace(/\\[Nn]/g, '\n') // \n / \N → newline
+ .replace(/\\,/g, ',') // \, → ,
+ .replace(/\\;/g, ';') // \; → ;
+ .replace(/\\\\/g, '\\') // \\ → \
+ .replace(/[\n\r;]+/g, ', ') // newlines / semicolons → ", "
+ .replace(/\s*,\s*/g, ', ') // normalize spaces around commas
+ .replace(/(?:,\s*){2,}/g, ', ') // collapse double commas
+ .replace(/ +/g, ' ')
+ .replace(/^[,\s]+|[,\s]+$/g, ''); // trim leading/trailing commas
+}