--- phpdoc\chm\make_chm_fancy.php.old	Fri Sep 03 15:32:26 2004
+++ phpdoc\chm\make_chm_fancy.php	Fri Sep 03 15:49:32 2004
@@ -76,6 +76,12 @@
     // Get the contents of the file from $HTML_PATH
     $content = oneLiner("$HTML_PATH/$fname", true);
 
+    // Correct <!DOCTYPE declaration if it is missed from the output
+    if (substr($content, 0, 9) !== "<!DOCTYPE") { 
+        $content = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n"
+                 . $content;
+    }
+
     // CSS file linking
     $content = preg_replace("|</HEAD|", '<LINK REL="stylesheet" HREF="style.css"></HEAD', $content);
 
