From 3f49d48ae608d5fb618453a8e2fa875b9d5420e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sun, 3 Nov 2019 13:36:22 +0100 Subject: Readd color parsing, fix minor bugs. --- module/vcomponent/base.scm | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'module/vcomponent/base.scm') diff --git a/module/vcomponent/base.scm b/module/vcomponent/base.scm index f43f532e..86ea40e8 100644 --- a/module/vcomponent/base.scm +++ b/module/vcomponent/base.scm @@ -16,11 +16,12 @@ (let ((parent (primitive-make-vcomponent))) (for-each (lambda (child) (add-child! parent child)) (read-vcalendar path)) - (if (null? (get-component-children parent)) - (set-attribute! parent 'X-HNH-SOURCETYPE "vdir") - (set-attribute! parent 'X-HNH-SOURCETYPE - (get-attribute-value (car (get-component-children parent)) - 'X-HNH-SOURCETYPE "vdir"))) + (set-attribute! + parent 'X-HNH-SOURCETYPE + (if (null? (get-component-children parent)) + "vdir" + (get-attribute-value (car (get-component-children parent)) + 'X-HNH-SOURCETYPE "vdir"))) parent)) ;; vline → value @@ -72,7 +73,7 @@ (define-public parent get-component-parent) (define-public (attributes component) - (hash-map->list cons (get-component-attributes component))) + (map car (hash-map->list cons (get-component-attributes component)))) (define*-public children get-component-children) -- cgit v1.2.3