Merge pull request #868 from arthurgleckler/master

Fix bug: attributes without values didn't work.
This commit is contained in:
Alex Shinn 2022-10-12 16:44:55 +09:00 committed by GitHub
commit b1750cee57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -40,11 +40,11 @@
(lambda (out) (html-display-escaped-attr (display-to-string str) out))))
(define (html-attr->string attr)
(if (cdr attr)
(if (null? (cdr attr))
(symbol->string (car attr))
(let ((val (if (pair? (cdr attr)) (cadr attr) (cdr attr))))
(string-append (symbol->string (car attr))
"=\"" (html-escape-attr val) "\""))
(symbol->string (car attr))))
"=\"" (html-escape-attr val) "\""))))
(define (html-tag->string tag attrs)
(let lp ((ls attrs) (res (list (symbol->string tag) "<")))