[xml] Allow multi-line bodies w/o CDATA. Strip trailing whitespace.

This commit is contained in:
Jeroen van Rijn
2021-12-05 02:52:22 +01:00
parent 682783a2aa
commit 32eab04d66
2 changed files with 24 additions and 6 deletions
+6 -3
View File
@@ -27,10 +27,13 @@ print :: proc(writer: io.Writer, doc: ^Document) -> (written: int, err: io.Error
}
written += wprintf(writer, "[Encoding] %v\n", doc.encoding)
written += wprintf(writer, "[DOCTYPE] %v\n", doc.doctype.ident)
if len(doc.doctype.rest) > 0 {
wprintf(writer, "\t%v\n", doc.doctype.rest)
if len(doc.doctype.ident) > 0 {
written += wprintf(writer, "[DOCTYPE] %v\n", doc.doctype.ident)
if len(doc.doctype.rest) > 0 {
wprintf(writer, "\t%v\n", doc.doctype.rest)
}
}
if doc.root != nil {