Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Moved render-html above render-element.

  • Loading branch information...
commit 1670cb5beb7625b6473f7fff3fd374b0b23ae240 1 parent 5fda964
@r0man authored
View
8 src/cljs/hiccup/compiler.cljs
@@ -51,6 +51,10 @@
[tag (merge tag-attrs map-attrs) (next content)]
[tag tag-attrs content])))
+(defmulti render-html
+ "Turn a Clojure data type into a string of HTML."
+ type)
+
(defn- render-element
"Render an element vector as a HTML element."
[element]
@@ -61,10 +65,6 @@
"</" tag ">")
(str "<" tag (render-attr-map attrs) (end-tag)))))
-(defmulti render-html
- "Turn a Clojure data type into a string of HTML."
- type)
-
(defmethod render-html Cons [cons]
(apply str (map render-html cons)))
View
2  test/cljs/hiccup/test/core.cljs
@@ -107,7 +107,7 @@
"<input checked=\"checked\" type=\"checkbox\" />"))
(assert (= (html {:mode :sgml} [:input {:type "checkbox" :checked true}])
"<input checked type=\"checkbox\">"))
- laziness and binding scope
+ ;; laziness and binding scope
(assert (= (html {:mode :sgml} [:html [:link] (list [:link])])
"<html><link><link></html>")))
Please sign in to comment.
Something went wrong with that request. Please try again.