(document.write
(ps-html ((:a :href "#"
:onclick (lisp (ps-inline (transport)))) "link")))
- => document.write('<a href=\"#\" onclick=\"' + 'javascript:transport();' + '\">link</a>')
+ => document.write('<a href=\"#\" onclick=\"' + 'javascript:transport()' + '\">link</a>')
;;; Forms may be used in attribute lists to conditionally generate
;;; the next attribute. In this example the textarea is sometimes disabled.
Body is evaluated."
(compile-script `(progn ,@body)))
-(defun ps-inline* (form)
- (concatenate 'string
- "javascript:"
- (remove #\Newline
- (parenscript-print (compile-parenscript-form form :expecting :statement))
- :from-end t)))
+(defun ps-inline* (form &optional (quote-char #\"))
+ (let ((*js-quote-char* quote-char))
+ (concatenate 'string
+ "javascript:"
+ (remove #\Newline
+ (parenscript-print (compile-parenscript-form form :expecting :statement))
+ :from-end t))))
-(defmacro ps-inline (&body body)
- `(ps-inline* '(progn ,@body)))
+(defmacro ps-inline (form &optional (quote-char #\"))
+ `(ps-inline* ',form ,quote-char))
:onclick (lisp (ps-inline (transport))))
img))
img))
- "document.write(LINKORNOT == 1 ? '<a href=\"#\" onclick=\"' + 'javascript:transport();' + '\">' + img + '</a>' : img)")
+ "document.write(LINKORNOT == 1 ? '<a href=\"#\" onclick=\"' + 'javascript:transport()' + '\">' + img + '</a>' : img)")
(test-ps-js negate-number-literal ;; ok, this was broken and fixed before, but no one bothered to add the test!
(- 1)
(document.write
(ps-html ((:a :href "#"
:onclick (lisp (ps-inline (transport)))) "link")))
- "document.write('<a href=\"#\" onclick=\"' + 'javascript:transport();' + '\">link</a>')")
+ "document.write('<a href=\"#\" onclick=\"' + 'javascript:transport()' + '\">link</a>')")
(test-ps-js the-html-generator-4
(let ((disabled nil)