xml.writer: do not include meaningless extra whitespace in doctype

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.
db4
Benjamin Pollack 2016-03-11 16:18:29 -05:00
parent 4ef42357e1
commit 2ad91ce941
1 changed files with 4 additions and 3 deletions

View 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 ;