Browse Source

verify Fixed compojure's fortunes test

Mike Smith 11 years ago
parent
commit
f58a141be6
1 changed files with 15 additions and 14 deletions
  1. 15 14
      compojure/hello/src/hello/handler.clj

+ 15 - 14
compojure/hello/src/hello/handler.clj

@@ -6,7 +6,8 @@
         korma.db
         korma.db
         korma.core
         korma.core
         hiccup.core
         hiccup.core
-        hiccup.util)
+        hiccup.util
+        hiccup.page)
   (:require [compojure.handler :as handler]
   (:require [compojure.handler :as handler]
             [compojure.route :as route]
             [compojure.route :as route]
             [clojure.java.jdbc :as jdbc]
             [clojure.java.jdbc :as jdbc]
@@ -126,19 +127,19 @@ message text, and then return the results."
 
 
 (defn fortunes-hiccup [fortunes]
 (defn fortunes-hiccup [fortunes]
   "Render the given fortunes to simple HTML using Hiccup."
   "Render the given fortunes to simple HTML using Hiccup."
-  (html
-   [:head
-    [:title "Fortunes"]]
-   [:body
-    [:table
-     [:tr
-      [:th "id"]
-      [:th "message"]]
-     (for [x fortunes]
-       [:tr
-        [:td (:id x)]
-        [:td (escape-html-local (:message x))]])
-     ]]))
+  (html5
+    [:head
+     [:title "Fortunes"]]
+    [:body
+     [:table
+      [:tr
+       [:th "id"]
+       [:th "message"]]
+      (for [x fortunes]
+        [:tr
+         [:td (:id x)]
+         [:td (escape-html-local (:message x))]])
+      ]]))
 
 
 (defn fortunes-enlive [fortunes]
 (defn fortunes-enlive [fortunes]
   "Render the given fortunes to simple HTML using Enlive."
   "Render the given fortunes to simple HTML using Enlive."