diff --git a/guix-data-service/web/sxml.scm b/guix-data-service/web/sxml.scm index 5b478e0..1465c6f 100644 --- a/guix-data-service/web/sxml.scm +++ b/guix-data-service/web/sxml.scm @@ -29,6 +29,7 @@ #:use-module (ice-9 match) #:use-module (ice-9 format) #:use-module (ice-9 hash-table) + #:use-module (ice-9 textual-ports) #:export (sxml->html)) (define %self-closing-tags @@ -310,7 +311,7 @@ (let ((escaped (hash-ref %escape-chars c))) (if escaped (format port "&~a;" escaped) - (display c port)))) + (put-char port c)))) (string-for-each escape s)) (define (object->escaped-html obj port) @@ -329,7 +330,7 @@ "Write ATTR and VALUE to PORT." (format port "~a=\"" attr) (attribute-value->html value port) - (display #\" port)) + (put-char port #\")) (define (element->html tag attrs body port) "Write the HTML TAG to PORT, where TAG has the attributes in the @@ -337,13 +338,13 @@ list ATTRS and the child nodes in BODY." (format port "<~a" tag) (for-each (match-lambda ((attr value) - (display #\space port) + (put-char port #\space) (attribute->html attr value port))) attrs) (if (and (null? body) (self-closing-tag? tag)) - (display " />" port) + (put-string port " />") (begin - (display #\> port) + (put-char port #\>) (for-each (cut sxml->html <> port) body) (format port "" tag)))) @@ -358,7 +359,7 @@ list ATTRS and the child nodes in BODY." (doctype->html type port)) ;; Unescaped, raw HTML output (('raw html) - (display html port)) + (put-string port html)) (('*ENTITY* name) (simple-format port "&~A;" name)) (((? symbol? tag) ('@ attrs ...) body ...)