Permalink
Browse files

Make sure we replace all instances of each character to be escaped.

  • Loading branch information...
arthuredelstein committed Jun 27, 2012
1 parent 0783eb3 commit 6b77e0f4a39677e6db263cf58e6cdc4e9916e945
Showing with 5 additions and 5 deletions.
  1. +5 −5 src/crate/util.cljs
View
@@ -20,11 +20,11 @@
(defn escape-html
"Change special characters into HTML character entities."
[text]
- (.. (as-str text)
- (replace "&" "&")
- (replace "<" "&lt;")
- (replace ">" "&gt;")
- (replace "\"" "&quot;")))
+ (-> (as-str text)
+ (str/replace "&" "&amp;")
+ (str/replace "<" "&lt;")
+ (str/replace ">" "&gt;")
+ (str/replace "\"" "&quot;")))
(defn to-uri
"Prepends the base-url to the supplied URI."

0 comments on commit 6b77e0f

Please sign in to comment.