diff --git a/htmlout.scm b/htmlout.scm index 750f7af..1e4a636 100644 --- a/htmlout.scm +++ b/htmlout.scm @@ -26,7 +26,7 @@ ;;; (define (emit-tag out tag . attrs) - (let ((out (if (eq? out #t) (current-output-port) out))) + (let ((out (fmt->port out))) (display "<" out) (display tag out) (for-each (lambda (attr) @@ -118,11 +118,12 @@ (define (with-tag* out tag thunk . attrs) (apply emit-tag out tag attrs) - (call-with-values thunk - (lambda results - (newline out) - (emit-close-tag out tag) - (apply values results)))) + (let ((out (fmt->port out))) + (call-with-values thunk + (lambda results + (newline out) + (emit-close-tag out tag) + (apply values results))))) (define (fmt->port x) @@ -132,9 +133,6 @@ ;;; double-quote to their HTML escape sequences. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Mike Sperber -;; This is fairly simple-minded - ;; Note iso8859-1 above 127 is perfectly OK (define *html-entity-alist* @@ -194,4 +192,4 @@ (define (emit-text s . maybe-port) (if (null? maybe-port) (write-string (escape-html s)) - (write-string (escape-html s) (car maybe-port)))) \ No newline at end of file + (write-string (escape-html s) (fmt->port (car maybe-port)))))