Skip to content
Browse files

fix issue#1: Failed with class names with dash (-)

  • Loading branch information...
1 parent 9c5d37c commit c076415d08d5808558b017a4691d5922d4a338b7 Takahiro Hozumi committed Jul 25, 2012
Showing with 4 additions and 2 deletions.
  1. +1 −1 src/leiningen/hicv.clj
  2. +3 −1 test/leiningen/hicv_test.clj
View
2 src/leiningen/hicv.clj
@@ -43,7 +43,7 @@
(when class
(apply str
(interleave (repeat ".")
- (re-seq #"\w+" class)))))))
+ (re-seq #"[^ ]+" class)))))))
(defn- enlive-node2hiccup [node]
(if (map? node)
View
4 test/leiningen/hicv_test.clj
@@ -14,7 +14,9 @@
(is (= :img#myid (#'hicv/id&class-tag "img" {:id "myid"})))
(is (= :img#myid.myclass (#'hicv/id&class-tag "img" {:id "myid" :class "myclass"})))
(is (= :img#myid.myclass1.myclass2
- (#'hicv/id&class-tag "img" {:id "myid" :class "myclass1 myclass2"}))))
+ (#'hicv/id&class-tag "img" {:id "myid" :class "myclass1 myclass2"})))
+ (is (= :img.foo.bar-foo
+ (#'hicv/id&class-tag "img" {:class "foo bar-foo"}))))
(deftest ensure-under-hicv-dir-test
(is (= "hicv/aaa.html" (#'hicv/ensure-under-hicv-dir "hicv/aaa.html")))

0 comments on commit c076415

Please sign in to comment.
Something went wrong with that request. Please try again.