html: Add sxml->html-string.

* haunt/build/html.scm (sxml->html-string): New procedure.
This commit is contained in:
David Thompson 2015-04-11 23:34:47 -04:00
parent 44fdd16202
commit fc06ea3d9d
1 changed files with 8 additions and 1 deletions

View File

@ -28,7 +28,8 @@
#:use-module (ice-9 match)
#:use-module (ice-9 format)
#:use-module (ice-9 hash-table)
#:export (sxml->html))
#:export (sxml->html
sxml->html-string))
(define %void-elements
'(area
@ -368,3 +369,9 @@ list ATTRS and the child nodes in BODY."
(string->escaped-html text port))
;; Render arbitrary Scheme objects, too.
(obj (object->escaped-html obj port))))
(define (sxml->html-string sxml)
"Render SXML as an HTML string."
(call-with-output-string
(lambda (port)
(sxml->html sxml port))))