From b62ae7068837b18e83948abd1685f5b1b2da52d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Fri, 5 Jun 2020 21:48:11 +0200 Subject: Filter out ALL X-HNH- fields from ics output. --- module/output/ical.scm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'module/output/ical.scm') diff --git a/module/output/ical.scm b/module/output/ical.scm index 02dd5d64..fd4091ed 100644 --- a/module/output/ical.scm +++ b/module/output/ical.scm @@ -97,6 +97,11 @@ (ical-line-fold (string-drop string wrap-len)))] [else string])) +(define* (internal-field? symbol optional: (prefix "X-HNH-")) + (string=? prefix + (string-take-to (symbol->string symbol) + (string-length prefix)))) + (define-public (component->ical-string component) (format #t "BEGIN:~a\r\n" (type component)) ;; TODO this leaks internal information, @@ -105,11 +110,8 @@ ;; Special cases depending on key. ;; Value formatting is handled in @code{value-format}. (match-lambda* - ;; Handled below - [('X-HNH-ALTERNATIVES _) 'noop] - ;; Remove from output - [('X-HNH-FILENAME _) 'noop] + [(? (compose internal-field? car)) 'noop] [(key (vlines ...)) (for vline in vlines -- cgit v1.2.3