   {[:.topiq] (set-attr "id" (str "topiq-" (:id topiq)))
    [:.argument-counter] (content (-> (get-arguments (:id topiq) app) count))
    [:.argument-ref] (do->
-                    (set-attr :href (str "#" (:id topiq)))
-                    (listen :on-click #(om/set-state! owner :selected-topiq (:id topiq))))
+                     (set-attr :href (str "#" (:id topiq)))
+                     (listen :on-click #(om/set-state! owner :selected-topiq (:id topiq))))
    [:.topiq-text] (html-content
                    (let [text (replace-hashtags (:title topiq))]
-                     (if (:detail-url topiq)
-                       (clojure.string/replace
-                        text
-                        (re-pattern (:detail-url topiq))
-                        (str "<a href='" (:detail-url topiq) "' target='_blank'> "(:detail-url topiq) " </a>"))
-                       text)))
+                     (reduce
+                      #(clojure.string/replace %1 %2 (str "<a href='" %2 "' target='_blank'> link </a>"))
+                      text
+                      (map first (re-seq url-regexp text)))))
    [:.topiq-author] (content (:author topiq))
    [:.topiq-ts] (content (compute-time-diff (:ts topiq)))
    [:.topiq-vote-group] (substitute (topiq-vote-group (om/get-state owner :stage)

  {[:.topiq-text] (html-content
                   (let [topiq (get-topiq (om/get-state owner :selected-topiq) @db)
                         text (replace-hashtags (:title topiq))]
                     (if (:detail-url topiq)
                       (clojure.string/replace
                        text
                        (re-pattern (:detail-url topiq))
                        (str " <a href='" (:detail-url topiq) "' target='_blank'> " (:detail-url topiq) " </a> " ))
                       text)))
   [:.topiq-author] (content (:author (get-topiq (om/get-state owner :selected-topiq) @db)))
   [:.topiq-ts] (content (compute-time-diff (:ts (get-topiq (om/get-state owner :selected-topiq) @db))))
   [:#back-btn] (listen :on-click #(om/set-state! owner :selected-topiq nil))

    (if (= "Not logged in" username)
      (js/alert "Please login or register.")
      (try
        (let [text (dom/value (dom/by-id "general-input-form"))]
          (if (> (count text) 10)
            (if selected-topiq
              (add-argument stage username selected-topiq text)
              (add-topiq stage username text))
            (js/alert "Not enough input.")))
        (dom/set-value! (dom/by-id "general-input-form") "")
        (catch js/Object e
            (js/alert e))))))
