summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--haunt/build/html.scm9
1 files changed, 8 insertions, 1 deletions
diff --git a/haunt/build/html.scm b/haunt/build/html.scm
index b95ca81..5c6455d 100644
--- a/haunt/build/html.scm
+++ b/haunt/build/html.scm
@@ -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))))