r20643 - gnucash/branches/2.4/src/report/report-system - [20639] Bug #650139: Fix missing doctype preventing HTML 4.01 transitional validation

Christian Stimming cstim at code.gnucash.org
Fri May 13 16:22:32 EDT 2011

Author: cstim
Date: 2011-05-13 16:22:32 -0400 (Fri, 13 May 2011)
New Revision: 20643
Trac: http://svn.gnucash.org/trac/changeset/20643

[20639] Bug #650139: Fix missing doctype preventing HTML 4.01 transitional validation

Patch by "Bert":

This patch fixes part of the missing doctype for most reports through

Exported reports lack a document type, preventing HTML validation.

When exporting this may lead browsers to incorrectly read the reports generated
by GnuCash.

The attached patch aims for HTML 4.01 transitional validation of reports in the
long term and thus adds this doctype on top of the reports. While it is far
from perfect, 4.01 Trans looks like a good first target and can be read by most
(including older) browsers.

Modified: gnucash/branches/2.4/src/report/report-system/html-document.scm
--- gnucash/branches/2.4/src/report/report-system/html-document.scm	2011-05-13 20:22:22 UTC (rev 20642)
+++ gnucash/branches/2.4/src/report/report-system/html-document.scm	2011-05-13 20:22:32 UTC (rev 20643)
@@ -153,6 +153,11 @@
               (gnc:report-render-starting (gnc:html-document-title doc)))
           (if (not (null? headers?))
+                ;;This is the only place where <html> appears
+                ;;with the exception of 2 reports: 
+                ;;./share/gnucash/guile-modules/gnucash/report/taxinvoice.eguile.scm:<html>
+                ;;./share/gnucash/guile-modules/gnucash/report/balsheet-eg.eguile.scm:<html>
+                (push "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \n\"http://www.w3.org/TR/html4/loose.dtd\">") ;;trying 4.01 Trans
                 (push "<html>\n")
                 (push "<head>\n")
                 (push "<meta http-equiv=\"content-type\" content=\"text-html; charset=utf-8\">\n")

More information about the gnucash-changes mailing list