mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-18 21:29:19 +02:00
Fix bug: attributes without values didn't work.
Before, it was necessary to do something like this: (option (@ (selected . #false) (value "any")) "any") instead of: (option (@ (selected) (value "any")) "any") Only the former is valid SXML, as far as I can tell from the SXML specification: <https://dl.acm.org/doi/pdf/10.1145/571727.571736>
This commit is contained in:
parent
24339e51e7
commit
73875cbaf7
1 changed files with 3 additions and 3 deletions
|
@ -40,11 +40,11 @@
|
||||||
(lambda (out) (html-display-escaped-attr (display-to-string str) out))))
|
(lambda (out) (html-display-escaped-attr (display-to-string str) out))))
|
||||||
|
|
||||||
(define (html-attr->string attr)
|
(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))))
|
(let ((val (if (pair? (cdr attr)) (cadr attr) (cdr attr))))
|
||||||
(string-append (symbol->string (car attr))
|
(string-append (symbol->string (car attr))
|
||||||
"=\"" (html-escape-attr val) "\""))
|
"=\"" (html-escape-attr val) "\""))))
|
||||||
(symbol->string (car attr))))
|
|
||||||
|
|
||||||
(define (html-tag->string tag attrs)
|
(define (html-tag->string tag attrs)
|
||||||
(let lp ((ls attrs) (res (list (symbol->string tag) "<")))
|
(let lp ((ls attrs) (res (list (symbol->string tag) "<")))
|
||||||
|
|
Loading…
Add table
Reference in a new issue