diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-11-26 15:32:41 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-11-26 15:32:41 +0100 |
commit | 1df15b2ceaef09b48a39aa6046b577da11ea2f72 (patch) | |
tree | cf8dd5340703961c53daae1b2e7d0535d785f6d4 /module/vcomponent/xcal | |
parent | Slightly better error hnadling in directory-table. (diff) | |
download | calp-1df15b2ceaef09b48a39aa6046b577da11ea2f72.tar.gz calp-1df15b2ceaef09b48a39aa6046b577da11ea2f72.tar.xz |
Got categories working.
Diffstat (limited to '')
-rw-r--r-- | module/vcomponent/xcal/parse.scm | 43 |
1 files changed, 36 insertions, 7 deletions
diff --git a/module/vcomponent/xcal/parse.scm b/module/vcomponent/xcal/parse.scm index 124a91f4..48ce301e 100644 --- a/module/vcomponent/xcal/parse.scm +++ b/module/vcomponent/xcal/parse.scm @@ -171,11 +171,25 @@ ;; 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)))))] + (let () + (define vline + (make-vline tag* + (handle-tag + tag (handle-value type params value)) + params)) + (if (memv tag* '(ATTACH ATTENDEE CATEGORIES + COMMENT CONTACT EXDATE + REQUEST-STATUS RELATED-TO + RESOURCES RDATE + ;; x-prop + ;; iana-prop + )) + (aif (prop* component tag*) + (set! (prop* component tag*) (cons vline it)) + (set! (prop* component tag*) (list vline))) + ;; else + (set! (prop* component tag*) vline)) + ))))] [(tag (type value ...) ...) (for (type value) in (zip type value) @@ -184,7 +198,7 @@ (unless (null? value) (let ((params (make-hash-table)) (tag* (symbol-upcase tag))) - (set! (prop* component tag*) + (define vline (make-vline tag* (handle-tag tag (let ((v (handle-value type params value))) @@ -192,7 +206,22 @@ (if (eq? tag 'categories) (string-split v #\,) v))) - params)))))]))) + params)) + ;; + + (if (memv tag* '(ATTACH ATTENDEE CATEGORIES + COMMENT CONTACT EXDATE + REQUEST-STATUS RELATED-TO + RESOURCES RDATE + ;; x-prop + ;; iana-prop + )) + (aif (prop* component tag*) + (set! (prop* component tag*) (cons vline it)) + (set! (prop* component tag*) (list vline))) + ;; else + (set! (prop* component tag*) vline)) + )))]))) ;; children (awhen (assoc-ref sxcal 'components) |