     [editor/text (str/trim-newline output)]]
    [:hr.border]])
 
+(defn render-value [value]
+  (cond
+    (string? value)
+    [editor/code (-> value unescape-string pprint-str)]
+
+    (map? value)
+    (case (:type value)
+      :hiccup (:content value)
+      [editor/code (pprint-str value)])
+
+    :default
+    [editor/code (pprint-str value)]))
+
+(defn render-error [error]
+  [:pre.error
+   (or (:stack error)
+       (if (and (:message error) (not= "ERROR" (:message error)))
+         (:message error)
+         (str (:cause error))
+         #_(or (str (:cause error)) (str error))))])
+
+
+(defn render-progress []
+  [mdl/upgrade
+   [:div.mdl-progress.mdl-js-progress.mdl-progress__indeterminate {:style {:width "100%"}}]])
+
 (defn history-card-result [props {:keys [success? value error] :as result}]
   [:div.card-data.result
    (if result
      (if success?
-       (if (string? value)
-         [editor/code (str "\"" value "\"")]
-         [editor/code (pprint-str value)])
-       [:div.error
-        (when-not (= "ERROR" (:message error))
-          [:div.error (:message error)])
-        (when (:cause error)
-          [:div.error (:cause error)])])
-     [mdl/upgrade
-      [:div.mdl-progress.mdl-js-progress.mdl-progress__indeterminate {:style {:width "100%"}}]])])
-
-(defn history-card
-  [{:keys [state columns] :as props} {:keys [ns expression result output] :as history-item}]
+       [render-value value]
+       [render-error error])
+     [render-progress])])
+
+(defn history-card [{:keys [state columns] :as props} {:keys [ns expression result output] :as history-item}]
   [:div
    {:class (str "mdl-cell " (card-size-class columns))}
    [:div.mdl-card.mdl-shadow--2dp

     [:div.flex-h
      [repl-input props]
      [run-button props]]]]])

(defn input-ok? [{:keys [history]}]
  (or (= (count history) 0)
      (some? (-> history last second :result))))


(defn history [props]

  (-> (with-out-str (fipp/pprint data))
      (str/trim-newline)))

(defn unescape-string [data]
  (-> (println-str data)
      (str/trim-newline)))

(defn trigger
  "Returns a reagent class that can be used to easily add triggers
  from the map in `props`, such as :component-did-mount.  See
