Skip to content

Commit

Permalink
Make sure we replace all instances of each character to be escaped.
Browse files Browse the repository at this point in the history
  • Loading branch information
arthuredelstein committed Jun 27, 2012
1 parent 0783eb3 commit 6b77e0f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/crate/util.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down

0 comments on commit 6b77e0f

Please sign in to comment.