Skip to content

Commit

Permalink
fix empty style value bug
Browse files Browse the repository at this point in the history
  • Loading branch information
retrogradeorbit committed Dec 4, 2019
1 parent 3dde2b9 commit bfa82b9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/bootleg/utils.clj
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@
(->> hiccup
(walk/postwalk
(fn [form]
(if (and (seqable? form) (empty? form))
(if (and (or (seq? form) (vector? form))
(empty? form))
nil
form)))))

Expand Down
8 changes: 7 additions & 1 deletion test/bootleg/hiccup_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -316,4 +316,10 @@
"")))
(testing "empty forms 3"
(is (= (process-hiccup-data "." "(convert-to [[nil nil] [[[[[[nil [nil [nil []]]]]]]] nil] []] :html)")
""))))
"")))
(testing "empty forms 4"
(is (= (process-hiccup-data "." "(convert-to [:img {:src \"/images/logo.png\", :alt \"\"}] :html)")
"<img alt=\"\" src=\"/images/logo.png\">")))
)

""

0 comments on commit bfa82b9

Please sign in to comment.