Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## Fixed

- Correctly handle boolean attributes (false values are removed rather than being set to "false")

## Changed

# 0.0.4 (2021-10-28 / 8c0198a)
Expand All @@ -13,4 +15,4 @@
- Initial implementation
- fragment support
- component support (fn? in first vector position)
- unsafe-html support
- unsafe-html support
5 changes: 4 additions & 1 deletion src/lambdaisland/hiccup.clj
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@
classes (keep (fn [^String seg]
(when (= \. (.charAt seg 0)) (subs seg 1)))
segments)
node {:tag (keyword tag-name) :attrs (if (attr-map? m) m {})
node {:tag (keyword tag-name)
:attrs (if (attr-map? m)
(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 (seq classes)
Expand Down