|
|
@ -41,9 +41,14 @@
|
|
|
|
;; general way of coercing to html
|
|
|
|
;; general way of coercing to html
|
|
|
|
(define+provide/contract (->html x)
|
|
|
|
(define+provide/contract (->html x)
|
|
|
|
(any/c . -> . string?)
|
|
|
|
(any/c . -> . string?)
|
|
|
|
|
|
|
|
;; todo: omit 'script and 'style tags (and ... ?)
|
|
|
|
(try (xexpr->string x)
|
|
|
|
(try (xexpr->string x)
|
|
|
|
(except [exn:fail? (make-coercion-error-handler 'html x)])))
|
|
|
|
(except [exn:fail? (make-coercion-error-handler 'html x)])))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; must get this right — no escaped chars
|
|
|
|
|
|
|
|
;(->html '(script ((type "text/javascript")) "3 > 2"))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;; general way of coercing to symbol
|
|
|
|
;; general way of coercing to symbol
|
|
|
|
(define+provide/contract (->symbol x)
|
|
|
|
(define+provide/contract (->symbol x)
|
|
|
|