Browse files

check comment or not

  • Loading branch information...
1 parent 2169405 commit f3a28240c99517b1487e30c3785c0a94d29c203d Takahiro Hozumi committed Jul 7, 2012
Showing with 10 additions and 7 deletions.
  1. +10 −7 src/leiningen/hicv.clj
View
17 src/leiningen/hicv.clj
@@ -61,13 +61,16 @@
(defn- enlive-node2hiccup [node]
(if (map? node)
- (let [{:keys [tag attrs content]} node
- tag (mk-tag tag attrs)
- attrs (dissoc attrs :class :id)
- hiccup-form (if (empty? attrs) [tag] [tag attrs])
- cnts (filter #(not (and (string? %)
- (re-matches #"\n\s*" %))) content)]
- (reduce conj hiccup-form (map enlive-node2hiccup cnts)))
+ ;; for comment node {:type :comment, :data "[if IE]> ..."}
+ (if (= :comment (:type node))
+ (str "<!--" (:data node) "-->")
+ (let [{:keys [tag attrs content]} node
+ tag (mk-tag tag attrs)
+ attrs (dissoc attrs :class :id)
+ hiccup-form (if (empty? attrs) [tag] [tag attrs])
+ cnts (filter #(not (and (string? %)
+ (re-matches #"\n\s*" %))) content)]
+ (reduce conj hiccup-form (map enlive-node2hiccup cnts))))
node))
(defn- url? [s]

0 comments on commit f3a2824

Please sign in to comment.