]> gitweb.factorcode.org Git - factor.git/commitdiff
xml.writer: do not include meaningless extra whitespace in doctype
authorBenjamin Pollack <benjamin@bitquabit.com>
Fri, 11 Mar 2016 21:18:29 +0000 (16:18 -0500)
committerBenjamin Pollack <benjamin@bitquabit.com>
Fri, 11 Mar 2016 23:20:55 +0000 (18:20 -0500)
This is theoretically merely annoying, but since we're using the XML vocab in
tons of places as an overenthusiastic HTML generator, and HTML5 technically
mandates that the first token needs to be `<!DOCTYPE html>` full-stop, this had
to get fixed.

basis/xml/writer/writer.factor

index 06c0fcf87d09365812361a38375c4d0114525608..0f7b339f38cb7b7527b0b7ddb38495bd149a16b0 100644 (file)
@@ -142,9 +142,10 @@ M: public-id write-xml
 
 M: doctype-decl write-xml
     ?indent "<!DOCTYPE " write
-    [ name>> write bl ]
-    [ external-id>> [ write-xml bl ] when* ]
-    [ internal-subset>> write-internal-subset ">" write ] tri ;
+    [ name>> write ]
+    [ external-id>> [ bl write-xml ] when* ]
+    [ internal-subset>> [ bl write-internal-subset ] when* ] tri
+    ">" write ;
 
 M: directive write-xml
     "<!" write text>> write CHAR: > write1 nl ;