aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-07-08 01:34:56 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-07-08 01:34:56 +0200
commit3862e80eccfcd702ca344de9d6d13bc30d896157 (patch)
treecabe010007fe536b064cee47982957b133ada416
parentTODO about list parser. (diff)
downloadcalp-3862e80eccfcd702ca344de9d6d13bc30d896157.tar.gz
calp-3862e80eccfcd702ca344de9d6d13bc30d896157.tar.xz
Repair ics output.
-rw-r--r--module/output/ical.scm5
-rw-r--r--module/output/types.scm2
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