From: Jason Yundt Date: Thu, 2 Jun 2022 11:43:05 +0000 (-0400) Subject: gitweb: switch to an XHTML5 DOCTYPE X-Git-Url: https://git.ladys.computer/Gitweb/commitdiff_plain/6745a06c525fbf2f19fa3a653269b3dad2f5d8ac0ceb81b2790a36cd7015d93f?ds=sidebyside;hp=d73e7f57c959e8c058edc2671fae5ff07ddb11457554afe6bf82b7409d35712a gitweb: switch to an XHTML5 DOCTYPE According to the HTML Standard FAQ: “What is the DOCTYPE for modern HTML documents? In text/html documents: In documents delivered with an XML media type: no DOCTYPE is required and its use is generally unnecessary. However, you may use one if you want (see the following question). Note that the above is well-formed XML.” Source: [1] Gitweb uses an XHTML 1.0 DOCTYPE: While that DOCTYPE is still valid [2], it has several disadvantages: 1. It’s misleading. If an XML parser uses the DTD at the given link, then the entities   and ⋅ won’t get declared. Instead, the parser has to use a DTD from the HTML Standard that has nothing to do with XHTML 1.0 [2]. 2. It’s obsolete. XHTML 1.0 was last revised in 2002 and was superseded in 2018 [3]. 3. It’s unreliable. Gitweb uses   and ⋅ but lets an external file define them. “[…U]using entity references for characters in XML documents is unsafe if they are defined in an external file (except for <, >, &, ", and ').” [4] [1]: [2]: [3]: [4]: Signed-off-by: Jason Yundt Signed-off-by: Junio C Hamano --- diff --git a/gitweb.perl b/gitweb.perl index ce2c48f..5d5401f 100755 --- a/gitweb.perl +++ b/gitweb.perl @@ -4220,7 +4220,10 @@ sub git_header_html { my $mod_perl_version = $ENV{'MOD_PERL'} ? " $ENV{'MOD_PERL'}" : ''; print < - + + +]>