          [:hr]
          (case (get tabs selected)
            "Post" (post-form (:posts cursor))
-           "Show" (om/build code-view (:posts cursor)))]))))
+           "Show" (om/build code-view cursor))]))
+    om/IDidUpdate
+    (did-update [_ _ _]
+      (let [code (-> js/document
+                     (.getElementById "codeview"))]
+        (when code
+          (.highlightBlock js/hljs code))))))
 
 (defn application [cursor owner]
   (reify


(enable-console-print!)

(defonce app-state (atom {:status :unconnected
                          :posts []}))

; WebSockets


; UI

(defn code-view [{:keys [selected posts] :as cursor} owner]
  (reify
    om/IRender
    (render [_]
      (html
        [:div
         [:div.col-xs-2
          [:ul.list-unstyled
           (map (fn [i]
                  [:li
                   {:on-click (fn [_] (om/update! cursor [:selected] i))}
                   ((if (= i selected) (fn [text] [:strong text]) identity) (str "Code " i))])
                (range (count posts) 0 -1))]]
         (when selected
           [:div.col-xs-10
            [:pre#codeview
             [:code (get posts (dec selected))]]])]))))

(defn submit-code [posts e]
  (let [code (-> js/document
