diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-08-13 10:43:33 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-08-13 10:43:33 +0200 |
commit | a902eb51621521d45c648d6a4d06d70d981dfaeb (patch) | |
tree | afc31d4d17fa3939585ad30878b5b690d3b80db3 /module/vcomponent/parse | |
parent | Add TODO's (diff) | |
parent | Comment about generalizing. (diff) | |
download | calp-a902eb51621521d45c648d6a4d06d70d981dfaeb.tar.gz calp-a902eb51621521d45c648d6a4d06d70d981dfaeb.tar.xz |
Merge branch 'calchooser' into master
Diffstat (limited to '')
-rw-r--r-- | module/vcomponent/parse/xcal.scm | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/module/vcomponent/parse/xcal.scm b/module/vcomponent/parse/xcal.scm index 76bdb251..2c8b7fe8 100644 --- a/module/vcomponent/parse/xcal.scm +++ b/module/vcomponent/parse/xcal.scm @@ -22,6 +22,7 @@ [(boolean) (string=? "true" (car value))] + ;; TODO possibly trim whitespace on text fields [(cal-address uri text unknown) (car value)] [(date) (parse-iso-date (car value))] @@ -126,21 +127,27 @@ (let ((params (handle-parameters parameters)) (tag* (symbol-upcase tag))) (for (type value) in (zip type value) - (set! (prop* component tag*) - (make-vline tag* - (handle-tag - tag (handle-value type params value)) - params))))] + ;; ignore empty fields + ;; mostly for <text/> + (unless (null? value) + (set! (prop* component tag*) + (make-vline tag* + (handle-tag + tag (handle-value type params value)) + params)))))] [(tag (type value ...) ...) (for (type value) in (zip type value) - (let ((params (make-hash-table)) - (tag* (symbol-upcase tag))) - (set! (prop* component tag*) - (make-vline tag* - (handle-tag - tag (handle-value type params value)) - params))))]))) + ;; ignore empty fields + ;; mostly for <text/> + (unless (null? value) + (let ((params (make-hash-table)) + (tag* (symbol-upcase tag))) + (set! (prop* component tag*) + (make-vline tag* + (handle-tag + tag (handle-value type params value)) + params)))))]))) ;; children (awhen (assoc-ref sxcal 'components) |