diff --git a/project.clj b/project.clj index e23d536..02cb3be 100644 --- a/project.clj +++ b/project.clj @@ -3,6 +3,7 @@ :dependencies [[org.clojure/clojure "1.4.0"] [org.clojure/clojure-contrib "1.2.0"] [hiccup "1.0.0"] + [ring/ring-core "1.1.0"] [cssgen "0.2.6"] [jayq "0.1.0-alpha2"] [fetch "0.1.0-alpha2"] @@ -10,17 +11,15 @@ [org.pegdown/pegdown "1.1.0"] [noir "1.3.0-beta1"]] :plugins [[lein-cljsbuild "0.1.10"]] - :cljsbuild { - :builds [{ - ; The path to the top-level ClojureScript source directory: - :source-path "src-cljs" - ; The standard ClojureScript compiler options: - ; (See the ClojureScript compiler documentation for details.) - :crossovers [NoteHub.crossover] - :compiler { - :output-dir "resources/public/cljs/" - :output-to "resources/public/cljs/main.js" ; default: main.js in current directory - :optimizations :whitespace - :pretty-print true}}]} + :jvm-opts ["-Dfile.encoding=utf-8"] + :cljsbuild + {:crossovers [NoteHub.crossover], + :builds + [{:source-path "src-cljs", + :compiler + {:output-dir "resources/public/cljs/", + :output-to "resources/public/cljs/main.js", + :optimizations :whitespace, + :pretty-print true}}]} :main NoteHub.server) diff --git a/src/NoteHub/views/pages.clj b/src/NoteHub/views/pages.clj index aaff6cc..4b48c00 100644 --- a/src/NoteHub/views/pages.clj +++ b/src/NoteHub/views/pages.clj @@ -8,6 +8,7 @@ [clojure.string :rename {replace sreplace} :only [split replace lower-case]] [clojure.core.incubator :only [-?>]] [hiccup.form] + [ring.util.codec :only [url-encode]] [hiccup.core] [hiccup.util :only [escape-html]] [noir.session :only [flash-put! flash-get]] @@ -52,7 +53,7 @@ ; Routes ; ====== -; This function answers to an AJAX request: it gets a sesion key and a markdown text. +; This function answers to an AJAX request: it gets a session key and a markdown text. ; It returns the html code of the provided markdown and a new session key. (defremote get-preview-md [session-key md] (when (flash-get session-key) @@ -151,6 +152,5 @@ (map #(str proposed-title "-" (+ 2 %)) (range)))))] (do (set-note date title draft) - ; TODO: the redirect is broken if title contains UTF chars - (redirect (url year month day title)))) + (redirect (url year month day (url-encode title))))) (response 400))))