From 3862e80eccfcd702ca344de9d6d13bc30d896157 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Wed, 8 Jul 2020 01:34:56 +0200 Subject: Repair ics output. --- module/output/ical.scm | 5 +++-- module/output/types.scm | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/module/output/ical.scm b/module/output/ical.scm index dd7653cb..d0dcd98c 100644 --- a/module/output/ical.scm +++ b/module/output/ical.scm @@ -27,7 +27,8 @@ ;; fields which can hold lists need not be considered here, ;; since they are split into multiple vlines when we parse them. (cond - [(and=> (param vline 'VALUE) string->symbol) => get-writer] + ;; TODO parameters return? One or many‽ + [(and=> (param vline 'VALUE) (compose string->symbol car)) => get-writer] [(memv key '(COMPLETED DTEND DUE DTSTART RECURRENCE-ID CREATED DTSTAMP LAST-MODIFIED ACKNOWLEDGED EXDATE)) @@ -125,7 +126,7 @@ [(key values ...) (string-append ";" (symbol->string key) - (string-join (map (compose (get-writer 'TEXT) ->string) values) + (string-join (map (compose escape-chars ->string) values) "," 'infix))]) (parameters vline))) ":" (value-format key vline)))) diff --git a/module/output/types.scm b/module/output/types.scm index 8eff2ee6..76a03ff1 100644 --- a/module/output/types.scm +++ b/module/output/types.scm @@ -46,7 +46,7 @@ ((@ (vcomponent recurrence internal) recur-rule->rrule-string) value)) -(define (escape-chars str) +(define-public (escape-chars str) (define (escape char) (string #\\ char)) (string-concatenate -- cgit v1.2.3