This commit is contained in:
paku 2024-04-17 16:06:19 +09:00
parent a2b6b1d99a
commit 9b4e206623
2 changed files with 7 additions and 10 deletions

View file

@ -58,7 +58,7 @@
:accessor element-prefix))) :accessor element-prefix)))
(defclass user-element (element) (defclass user-element (element)
((expand-to :initarg :expander ((expand-to :initarg :expander
:accessor user-element-expander))) :accessor user-element-expander)))
(defclass fragment (element) ()) (defclass fragment (element) ())
@ -228,11 +228,10 @@
(list prop `(attr attrs (make-keyword ',prop)))) (list prop `(attr attrs (make-keyword ',prop))))
props) props)
(let ((props (let ((props
(loop :for (key . value) in (attrs-alist attrs) (loop
:unless (member key :for (key . value) in (attrs-alist attrs)
',(mapcar #'make-keyword :unless (member key ',(mapcar #'make-keyword props))
props)) :append (list key value))))
:append (list key value))))
(declare (ignorable props)) (declare (ignorable props))
(progn ,@body)))))))) (progn ,@body))))))))
(defmacro ,name (&body attrs-and-children) (defmacro ,name (&body attrs-and-children)

View file

@ -32,14 +32,12 @@
(with-output-to-string (s) (with-output-to-string (s)
(loop (loop
:for c :across string :for c :across string
:do (write (escape-char c escape-map) :do (write (escape-char c escape-map) :stream s :escape nil)))
:stream s :escape nil)))
string)) string))
(defun escape-attrs-alist (alist) (defun escape-attrs-alist (alist)
(mapcar (lambda (kv) (mapcar (lambda (kv)
(cons (car kv) (cons (car kv) (escape-string (cdr kv) *attr-escape-map*)))
(escape-string (cdr kv) *attr-escape-map*)))
alist)) alist))
(defun escape-children (children) (defun escape-children (children)