change txexpr->html to xexpr->html

dev-53
Matthew Butterick 11 years ago
parent e3ef10b0ac
commit 1146b9d267

@ -259,8 +259,8 @@
(values tx-extracted (reverse matches)))
(define+provide+safe (txexpr->html x)
(txexpr? . -> . string?)
(define+provide+safe (xexpr->html x)
(xexpr? . -> . string?)
(define (->cdata x)
(if (cdata? x) x (cdata #f #f x)))

@ -222,15 +222,16 @@ Like @racket[txexpr->values], but returns the three components in a list.
]
@defproc[
(txexpr->html
[tx txexpr?])
(xexpr->html
[x xexpr?])
string?]
Convert @racket[_tx] to an HTML string. Better than @racket[xexpr->string] because consistent with the HTML spec, it will not escape text that appears within @code{script} or @code{style} blocks.
Convert @racket[_x] to an HTML string. Better than @racket[xexpr->string] because consistent with the HTML spec, it will not escape text that appears within @code{script} or @code{style} blocks. For convenience, this function will take any X-expression, not just tagged X-expressions.
@examples[#:eval my-eval
(define tx '(root (script "3 > 2") "Why is 3 > 2?"))
(xexpr->string tx)
(txexpr->html tx)
(xexpr->html tx)
(map xexpr->html (list "string" 'entity 65))
]

Loading…
Cancel
Save