aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-06-11 23:08:41 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2022-06-12 00:08:14 +0200
commit709c6f68da124d9fd916aa02f4bd95ca2c197db6 (patch)
treec3e8b21b2e7fadb59886c77417d7290554bcc27c
parentExtend sxml->html to copy procedures output verbatim. (diff)
downloadcalp-709c6f68da124d9fd916aa02f4bd95ca2c197db6.tar.gz
calp-709c6f68da124d9fd916aa02f4bd95ca2c197db6.tar.xz
Add <!DOCTYPE html> to xhtml-doc macro.
The doctype declaration is "required" when outputing regular HTML, and fine when output XHTML. Also remove the tests of xhtml-doc, since they basically just copied the deffinition (and stoped working since a procedure can't easily be tested for equality).
-rw-r--r--module/calp/html/components.scm1
-rw-r--r--tests/test/html/component.scm22
2 files changed, 1 insertions, 22 deletions
diff --git a/module/calp/html/components.scm b/module/calp/html/components.scm
index 9b3e4ce0..6ff59502 100644
--- a/module/calp/html/components.scm
+++ b/module/calp/html/components.scm
@@ -12,6 +12,7 @@
((_ (@ attr ...) body ...)
`(*TOP*
(*PI* xml "version=\"1.0\" encoding=\"utf-8\"")
+ ,(lambda () (format #t "~%<!DOCTYPE html>~%"))
(html (@ (xmlns "http://www.w3.org/1999/xhtml") attr ...)
body ...)))
((_ body ...)
diff --git a/tests/test/html/component.scm b/tests/test/html/component.scm
index 97581c50..050810be 100644
--- a/tests/test/html/component.scm
+++ b/tests/test/html/component.scm
@@ -7,28 +7,6 @@
:use-module (calp html components)
)
-(test-equal '(*TOP* (*PI* xml "version=\"1.0\" encoding=\"utf-8\"")
- (html (@ (xmlns "http://www.w3.org/1999/xhtml"))
- body))
- (xhtml-doc body))
-
-(test-equal '(*TOP* (*PI* xml "version=\"1.0\" encoding=\"utf-8\"")
- (html (@ (xmlns "http://www.w3.org/1999/xhtml"))
- (b "Hello, World!")))
- (xhtml-doc ,'(b "Hello, World!")))
-
-(test-equal
- '(*TOP* (*PI* xml "version=\"1.0\" encoding=\"utf-8\"")
- (html (@ (xmlns "http://www.w3.org/1999/xhtml")
- (lang sv))
- body))
- (xhtml-doc (@ (lang sv)) body))
-
-
-;; TODO Slider not tested, due to depending on gensyms, and really needing
-;; integration testing to be worth anything.
-
-
(test-equal
'(button (@ (class "btn") (onclick "onclick")) "Body")
(btn onclick: "onclick" "Body"))