 
 (defn- cleanup-name [n]
   (-> n
-      (clojure.string/replace #"[[\|]]" "")
+      (clojure.string/replace #"^\[\[|\]\]" "")
       (clojure.string/replace #"[\n\r]" "")
       (clojure.string/replace #"\"" "\\\\\"")))
 

(defn- generate-markers
  "return a string with the javascript code to generate addressPoints."
  [params]
  (let [mons (take 10000 (wcar* (car/smembers "frfr")))
        all (remove #(nil? %)
                    (for [m mons]
                      (let [res (read-string (wcar* (car/get m)))

                            emb (str "<img src=\\\"https://commons.wikimedia.org/w/index.php?title=Special%3AFilePath&file=" 
                                     img "&width=250\\\" />")
                            ilk (if (not (= imc ""))
                                  (str "<a href=\\\"http://commons.wikimedia.org/wiki/File:"
                                       img "\\\">" emb "</a>") "")
                            art (:monument_article res)
                            arl (format "<a href=\\\"http://%s.wikipedia.org/wiki/%s\\\">%s</a>" lng art art)
                            src (format "Source: <a target=\\\"blank\\\" href=\\\"%s\\\">%s</a>" reg id)]
                        (when (and lat lon nam)
                          (format "[%s,%s,\"%s\"]" lat lon (str "<h3>" nam "</h3>"
                                                                ilk "<br/>" (if art (str arl "<br/>") "")
                                                                src "<br/>"))))))]
    (str "var addressPoints = [" (str/join "," all) "];")))

(defn- index [params]
