Skip to content

Commit

Permalink
link element no longer has closing html tag (#963)
Browse files Browse the repository at this point in the history
closes #958
  • Loading branch information
alex-brook authored Oct 3, 2023
1 parent cbeade7 commit 6955a15
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
31 changes: 31 additions & 0 deletions src/std/xml-test.ss
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
(export xml-test)

(import :std/test :std/xml)

(def xml-test
(test-suite "test :std/xml"
(test-case "converting elements from sxml to html"
; normal elements with children include a closing tag
(check-output (print-sxml->html*
'(*TOP*
(div
(p "I'm paragraph one")
(p "I'm paragraph two"))))
"<div><p>I'm paragraph one</p><p>I'm paragraph two</p></div>")

; void elements must never include a closing tag
(check-output (print-sxml->html*
'(*TOP*
(area)
(base)
(br)
(col)
(embed)
(hr)
(img)
(input)
(link)
(meta)
(track)
(wbr)))
"<area><base><br><col><embed><hr><img><input><link><meta><track><wbr>"))))
2 changes: 1 addition & 1 deletion src/std/xml/sxml-to-xml.scm
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@
(@char>> #\/ port)))
(@char>> #\> port))))
(cond ((or (pair? content)
(memq nam '(iframe div span textarea link script style ul))) ; For XHTML support
(memq nam '(iframe div span textarea script style ul))) ; For XHTML support
(out>>/body>> (body->>> content))) ;; first I called it body->>> body>>/body. that would be sick
((null? content)
(end>>))
Expand Down

0 comments on commit 6955a15

Please sign in to comment.