From 8d81662ddcee0e35edf9b33814dcc2a91d778a69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Fri, 22 May 2020 22:54:07 +0200 Subject: Repair ical output for keys with multiple vlines. --- module/output/ical.scm | 10 ++++++++++ module/vcomponent/base.scm | 6 +++++- 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'module') diff --git a/module/output/ical.scm b/module/output/ical.scm index 87a85f82..cd97b346 100644 --- a/module/output/ical.scm +++ b/module/output/ical.scm @@ -116,6 +116,16 @@ ;; Remove from output [('X-HNH-FILENAME _) 'noop] + [(key (vlines ...)) + (for vline in vlines + (display + (ical-line-fold + ;; Expected output: key;p1=v;p3=10:value + (format #f "~a~:{;~a=~@{~a~^,~}~}:~a" + key (properties vline) + (value-format key vline)))) + (display "\r\n"))] + [(key vline) (display (ical-line-fold diff --git a/module/vcomponent/base.scm b/module/vcomponent/base.scm index 994ac197..9475addf 100644 --- a/module/vcomponent/base.scm +++ b/module/vcomponent/base.scm @@ -100,8 +100,12 @@ ;; vcomponent x (or str symb) → value (define (get-attr component key) - (get-attribute-value component (as-symb key) #f)) + (let ((attrs (get-attr* component key))) + (cond [(not attrs) #f] + [(list? attrs) (concatenate (map value attrs))] + [else (value attrs)]))) +;; TODO do something sensible here (define (set-attr! component key value) (set-attribute! component (as-symb key) value)) -- cgit v1.2.3