diff --git a/main.rkt b/main.rkt index 48ae6aa..1086841 100644 --- a/main.rkt +++ b/main.rkt @@ -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))) diff --git a/scribblings/txexpr.scrbl b/scribblings/txexpr.scrbl index 4323bef..7ce92e4 100644 --- a/scribblings/txexpr.scrbl +++ b/scribblings/txexpr.scrbl @@ -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)) ]