mighty-gerbils / gerbil

Gerbil Scheme
https://cons.io
GNU Lesser General Public License v2.1
1.15k stars 110 forks source link

`sxml->html` link tag closing #958

Closed alex-brook closed 11 months ago

alex-brook commented 11 months ago

The SXML -> HTML conversion methods add a closing </link> tag. But in HTML5 link is a void element that shouldn't have a closing tag. img is another void element, but seems to be working fine.

(import :std/xml)

(print-sxml->html* '(*TOP* (img)))
(displayln)
(print-sxml->html* '(*TOP* (link)))

; actual output:
; *** WARNING -- Variable "std/xml/sxml-to-xml#error" used in module "sxml-to-xml" is undefined
; <img>
; <link></link>

; expected output:
; <img>
; <link>

I think it may be happening because of this clause

; gerbil/src/std/xml/sxml-to-xml.scm
; ...

(cond ((or (pair? content)
         (memq nam '(iframe div span textarea link script style ul))) ; For XHTML support

; ...

I'm running gerbil with the gerbil:latest image

gxi --version
=> Gerbil 0.17.0-288-g7a4cd9f9 on Gambit v4.9.5-40-g24201248
vyzo commented 11 months ago

Sure, that should be easy to fix.

Care for a patch?