html: Add sxml->html-string.
* haunt/build/html.scm (sxml->html-string): New procedure.
This commit is contained in:
		@@ -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))))
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user