Remove support for vector attributes
This commit is contained in:
parent
55735c71cc
commit
a096d0be7b
1 changed files with 2 additions and 19 deletions
|
@ -85,16 +85,13 @@
|
||||||
((alistp (first attrs-and-children))
|
((alistp (first attrs-and-children))
|
||||||
(values (make-attrs :alist (first attrs-and-children))
|
(values (make-attrs :alist (first attrs-and-children))
|
||||||
(flatten (rest attrs-and-children))))
|
(flatten (rest attrs-and-children))))
|
||||||
((listp (first attrs-and-children))
|
((listp (first attrs-and-children)) ;plist
|
||||||
(values (make-attrs :alist (plist-alist (first attrs-and-children)))
|
(values (make-attrs :alist (plist-alist (first attrs-and-children)))
|
||||||
(flatten (rest attrs-and-children))))
|
(flatten (rest attrs-and-children))))
|
||||||
((hash-table-p (first attrs-and-children))
|
((hash-table-p (first attrs-and-children))
|
||||||
(values (make-attrs :alist (hash-alist (first attrs-and-children)))
|
(values (make-attrs :alist (hash-alist (first attrs-and-children)))
|
||||||
(flatten (rest attrs-and-children))))
|
(flatten (rest attrs-and-children))))
|
||||||
((and (vectorp (first attrs-and-children))
|
((keywordp (first attrs-and-children)) ;inline-plist
|
||||||
(keywordp (aref (first attrs-and-children) 0)))
|
|
||||||
(append-inline-attrs attrs-and-children))
|
|
||||||
((keywordp (first attrs-and-children))
|
|
||||||
(loop for thing on attrs-and-children by #'cddr
|
(loop for thing on attrs-and-children by #'cddr
|
||||||
for (k v) = thing
|
for (k v) = thing
|
||||||
when (and (keywordp k) v)
|
when (and (keywordp k) v)
|
||||||
|
@ -104,17 +101,3 @@
|
||||||
finally (return (values (make-attrs :alist attrs) nil))))
|
finally (return (values (make-attrs :alist attrs) nil))))
|
||||||
(t
|
(t
|
||||||
(values (make-attrs :alist nil) (flatten attrs-and-children)))))
|
(values (make-attrs :alist nil) (flatten attrs-and-children)))))
|
||||||
|
|
||||||
(defun append-inline-attrs (attrs-and-children)
|
|
||||||
(let* ((inline-attrs (coerce (first attrs-and-children) 'list))
|
|
||||||
(id (getf inline-attrs :id))
|
|
||||||
(class (getf inline-attrs :class)))
|
|
||||||
(multiple-value-bind (attrs children)
|
|
||||||
(split-attrs-and-children (rest attrs-and-children))
|
|
||||||
(when (and id (not (attr attrs :id)))
|
|
||||||
(setf (attr attrs :id) id))
|
|
||||||
(when class
|
|
||||||
(if-let (other-class (attr attrs :class))
|
|
||||||
(setf (attr attrs :class) (format nil "~a ~a" class other-class))
|
|
||||||
(setf (attr attrs :class) class)))
|
|
||||||
(values attrs children))))
|
|
||||||
|
|
Loading…
Reference in a new issue