From b7fc42229419015a031f70c0ee73fd7e9f845fda Mon Sep 17 00:00:00 2001 From: paku Date: Mon, 5 Feb 2024 01:47:26 +0900 Subject: [PATCH] Fix self-closing-p --- src/piccolo.lisp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/piccolo.lisp b/src/piccolo.lisp index bcbdd4f..9ecb5a2 100644 --- a/src/piccolo.lisp +++ b/src/piccolo.lisp @@ -122,15 +122,14 @@ When given :ASCII and :ATTR, it's possible to insert html text as a children, e. (format stream " ~{~a=~s~^ ~}" (alist-plist (attrs-alist attrs))) (format stream ""))) -(defun self-closing-p (element) - (gethash (if (symbolp element) - element - (intern (string-downcase element) #.*package*)) - #.(let ((self-closing-tags (make-hash-table))) - (loop :for tag :in '(area base br col embed hr img input keygen - link meta param source track wbr) - :do (setf (gethash tag self-closing-tags) tag)) - self-closing-tags))) +(defparameter *self-closing-tags* + '(area base br col embed hr img input keygen + link meta param source track wbr)) + +(defun self-closing-p (tag) + (member (make-symbol (string-upcase tag)) + *self-closing-tags* + :test #'string=)) (defmethod print-object ((element element) stream) (if (element-children element)