(defn normalize-element [[first second & rest]]
(when-not (or (keyword? first)
(symbol? first)
(string? first))
(throw (ex-info "Expected a keyword as a tag" { :tag first })))
(let [[tag tag-id tag-classes] (parse-selector first)
[attrs children] (if (or (map? second)
(nil? second))
[second rest]
[nil (cons second rest)])
attrs-classes (:class attrs)
classes (if (and tag-classes attrs-classes)
[tag-classes attrs-classes]
(or tag-classes attrs-classes))]
[tag tag-id classes attrs children]))