Skip to content

Commit

Permalink
Move escape-string to utilities.
Browse files Browse the repository at this point in the history
  • Loading branch information
Raynes committed Dec 9, 2012
1 parent dbd2f06 commit 7ef0e44
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 6 additions & 0 deletions src/refheap/utilities.clj
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@
(assoc paste
:contents (paste/pygmentize lexer contents)
:summary (paste/pygmentize lexer (paste/preview contents))))))
(defn escape-string
"Escapes all escape sequences in a string to make it suitable
for passing to another programming language. Kind of like what
pr-str does for strings but without the wrapper quotes."
[s]
(join (map #(char-escape-string % %) s)))
7 changes: 0 additions & 7 deletions src/refheap/views/paste.clj
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,6 @@
{:url (str (name scheme) "://" host "/paste/" (:paste-id paste) ".js")})
{:title (str "Embedding paste " id)})))

(defn escape-string
"Escapes all escape sequences in a string to make it suitable
for passing to another programming language. Kind of like what
pr-str does for strings but without the wrapper quotes."
[s]
(join (map #(char-escape-string % %) s)))

(defn embed-paste [id host scheme]
(content-type
"text/javascript"
Expand Down

0 comments on commit 7ef0e44

Please sign in to comment.