diff --git a/src/lambdaisland/hiccup.clj b/src/lambdaisland/hiccup.clj index 481dfc4..eac6f90 100644 --- a/src/lambdaisland/hiccup.clj +++ b/src/lambdaisland/hiccup.clj @@ -43,7 +43,8 @@ (into {} (filter val m)) {}) :content (enlive/flatmap #(nodify % opts) (if (attr-map? m) ms more))} - node (if id (assoc-in node [:attrs :id] id) node) + node (if (and id (not (contains? (:attrs node) :id))) + (assoc-in node [:attrs :id] id) node) node (if (seq classes) (update-in node [:attrs :class]