summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcolin <colin@cicadas.surf>2024-11-07 06:27:01 -0800
committercolin <colin@cicadas.surf>2024-11-07 06:27:01 -0800
commit3f3bd3392be3768c1d65d5a5edfd0f42178f851b (patch)
tree6ce78f34d6c55b03e26915043f207b44d0cfd7ec
parentaae175e6b9febf3fb80ca3e683af2e6227307079 (diff)
elem builder functions accept lists
-rw-r--r--src/hypnotisml.lisp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/hypnotisml.lisp b/src/hypnotisml.lisp
index 846e30f..b681f30 100644
--- a/src/hypnotisml.lisp
+++ b/src/hypnotisml.lisp
@@ -365,13 +365,14 @@ ENSURE-NODE."
STYLES is either null or a STYLES instance.
ATTRIBS is either null or an ATTRIBS instance.
CONTENTS is a list of NODE instances."
- (when (<= 2 (count-if #'styles-p contents))
- (warn "There should be at most 1 STYLES instance in your elem contents."))
- (when (<= 2 (count-if #'attribs-p contents))
- (warn "There should be at most 1 ATTRIBS instance in your elem contents."))
- (values (find-if #'styles-p contents)
- (find-if #'attribs-p contents)
- (filter-nodes contents)))
+ (let ((contents (a:flatten contents)))
+ (when (<= 2 (count-if #'styles-p contents))
+ (warn "There should be at most 1 STYLES instance in your elem contents."))
+ (when (<= 2 (count-if #'attribs-p contents))
+ (warn "There should be at most 1 ATTRIBS instance in your elem contents."))
+ (values (find-if #'styles-p contents)
+ (find-if #'attribs-p contents)
+ (filter-nodes contents))))
(macrolet ((defelems (&body tags)
(let ((children (gensym "children"))