]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
valadoc: Use HTML5 doctype in HTML doclet 391ec1209791157845732f2895aa0ef07b0fb6ef
authorAlistair Thomas <astavale@yahoo.co.uk>
Wed, 4 Jul 2018 19:42:41 +0000 (20:42 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Wed, 4 Jul 2018 20:01:41 +0000 (22:01 +0200)
libvaladoc/html/htmlmarkupwriter.vala

index 3a3be3de023e5bc59196332b2f38b7277c10f8fc..5aa4afdea2f176c9668a040ebd2f00781ac90715 100644 (file)
@@ -25,22 +25,30 @@ using Valadoc.Content;
 
 public class Valadoc.Html.MarkupWriter : Valadoc.MarkupWriter {
 
-       public MarkupWriter (FileStream stream, bool xml_declaration = true) {
+       public MarkupWriter (FileStream stream, bool html5_declaration = true) {
                // avoid broken implicit copy
                unowned FileStream _stream = stream;
 
                base ((str) => {
                        _stream.printf (str);
-               }, xml_declaration);
+               }, false);
+
+               if (html5_declaration) {
+                       do_write ("<!DOCTYPE html>");
+               }
        }
 
-       public MarkupWriter.builder (StringBuilder builder, bool xml_declaration = true) {
+       public MarkupWriter.builder (StringBuilder builder, bool html5_declaration = true) {
                // avoid broken implicit copy
                unowned StringBuilder _builder = builder;
 
                base ((str) => {
                        _builder.append (str);
-               }, xml_declaration);
+               }, false);
+
+               if (html5_declaration) {
+                       do_write ("<!DOCTYPE html>");
+               }
        }
 
        public unowned MarkupWriter add_usemap (Charts.Chart chart) {