From 0d51c5ec6377b8e3c217b6bf528fa1da15bbf7a4 Mon Sep 17 00:00:00 2001 From: paku Date: Wed, 13 Mar 2024 16:15:51 +0900 Subject: [PATCH] Enable boolean behavior of any attribute --- src/generator.lisp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/generator.lisp b/src/generator.lisp index 7eed5eb..2ea2a74 100644 --- a/src/generator.lisp +++ b/src/generator.lisp @@ -23,11 +23,6 @@ (defun ,(alx:symbolicate name '-p) (symbol) (gethash (alx:make-keyword (string-upcase symbol)) ,ht)))))) -(define-group boolean-attr-key - allowfullscreen async autofocus autoplay checked controls default defer - disabled formnovalidate inert ismap itemscope loop multiple muted nomodule - novalidate open playsinline readonly required reversed selected) - (define-group self-closing-tag area base br col embed hr img input keygen link meta param source track wbr) @@ -39,8 +34,7 @@ (defmethod print-object ((attrs elm:attrs) stream) (loop :for (key . value) :in (elm:attrs-alist attrs) - :do (format stream (if (and (boolean-attr-key-p key) - (typep value 'boolean)) + :do (format stream (if (typep value 'boolean) "~@[ ~a~]" " ~a=~s") (string-downcase key)