From 3815dd36b52072d7a6e46213e1051221f9e76438 Mon Sep 17 00:00:00 2001 From: paku Date: Sun, 4 Feb 2024 00:46:53 +0900 Subject: [PATCH] Wrap html element function with macro --- src/piccolo.lisp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/piccolo.lisp b/src/piccolo.lisp index e47dcc5..e50c0eb 100644 --- a/src/piccolo.lisp +++ b/src/piccolo.lisp @@ -75,12 +75,16 @@ When given :ASCII and :ATTR, it's possible to insert html text as a children, e. (defvar *builtin-elements* (make-hash-table)) -(defun html (&rest attrs-and-children) +(defun %html (&rest attrs-and-children) (multiple-value-bind (attrs children) (split-attrs-and-children attrs-and-children) (make-builtin-element-with-prefix :tag "html" :attrs attrs :children children :prefix ""))) + +(defmacro html (&body attrs-and-children) + `(%html ,@attrs-and-children)) + (setf (gethash :html *builtin-elements*) t) (defmacro define-builtin-element (element-name)