HCoop
/
clinton
/
parenscript.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d66981b
)
Need to escape #\' in javascript strings
author
Marco Baringer
<mb@bese.it>
Wed, 5 Oct 2005 09:09:42 +0000
(09:09 +0000)
committer
Marco Baringer
<mb@bese.it>
Wed, 5 Oct 2005 09:09:42 +0000
(09:09 +0000)
js.lisp
patch
|
blob
|
blame
|
history
diff --git
a/js.lisp
b/js.lisp
index
e12be54
..
2fb039c
100644
(file)
--- a/
js.lisp
+++ b/
js.lisp
@@
-383,7
+383,15
@@
this macro."
(defmethod js-to-strings ((string string-literal) start-pos)
(declare (ignore start-pos))
(defmethod js-to-strings ((string string-literal) start-pos)
(declare (ignore start-pos))
- (list (format nil "'~A'" (value string))))
+ (list (with-output-to-string (escaped)
+ (loop
+ initially (write-char #\' escaped)
+ for char across (value string)
+ if (char= #\' char)
+ do (write-string "\\'" escaped)
+ else
+ do (write-char char escaped)
+ finally (write-char #\' escaped)))))
;;; number literals
;;; number literals