{"thread":{"id":"57938","subject":"[PATCH] gitweb: switch to a modern DOCTYPE","startedAt":"2022-06-01T01:37:08Z","lastAt":"2022-06-02T22:09:45Z","messageCount":9,"participants":["Jason Yundt","brian m. carlson","Junio C Hamano","Bagas Sanjaya"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"456432","messageId":"20220601012647.1439480-1-jason@jasonyundt.email","threadId":"57938","inReplyTo":null,"subject":"[PATCH] gitweb: switch to a modern DOCTYPE","fromName":"Jason Yundt","fromEmail":"jason@jasonyundt.email","sentAt":"2022-06-01T01:26:47Z","receivedAt":"2022-06-01T01:37:08Z","isPatch":true,"sender":{"key":"jason@jasonyundt.email","avatar":"https://avatars.githubusercontent.com/u/5579359?v=4"},"body":"According to the HTML Standard FAQ:\n\n\t“What is the DOCTYPE for modern HTML documents?\n\n\tIn text/html documents:\n\n\t\t<!DOCTYPE html>\n\n\tIn documents delivered with an XML media type: no DOCTYPE is required\n\tand its use is generally unnecessary. However, you may use one if you\n\twant (see the following question). Note that the above is well-formed\n\tXML.”\n\n\tSource: [1]\n\nGitweb uses an XHTML 1.0 DOCTYPE:\n\n\t<!DOCTYPE html PUBLIC\n\t\"-//W3C//DTD XHTML 1.0 Strict//EN\"\n\t\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n\nWhile that DOCTYPE is still valid [2], it has several disadvantages:\n\n1. It’s misleading. The DTD that browsers are supposed to use with that\n   DOCTYPE has nothing to do with XHTML 1.0 and isn’t available at the URL\n   that is given [2].\n2. It’s obsolete. XHTML 1.0 was last revised in 2002 and was superseded in\n   2018 [3].\n3. It’s unreliable. Gitweb uses &nbsp; and &sdot; but lets an external file\n   define them. “[…U]using entity references for characters in XML documents\n   is unsafe if they are defined in an external file (except for &lt;, &gt;,\n   &amp;, &quot;, and &apos;).” [4]\n\n[1]: <https://github.com/whatwg/html/blob/main/FAQ.md#what-is-the-doctype-for-modern-html-documents>\n[2]: <https://html.spec.whatwg.org/multipage/xhtml.html#parsing-xhtml-documents>\n[3]: <https://www.w3.org/TR/xhtml1/#xhtml>\n[4]: <https://html.spec.whatwg.org/multipage/xhtml.html#writing-xhtml-documents>\n\nSigned-off-by: Jason Yundt <jason@jasonyundt.email>\n---\n gitweb/gitweb.perl                        |  5 ++++-\n t/t9502-gitweb-standalone-parse-output.sh | 14 ++++++++++++++\n 2 files changed, 18 insertions(+), 1 deletion(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 606b50104c..1835487ab2 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -4219,7 +4219,10 @@ sub git_header_html {\n \tmy $mod_perl_version = $ENV{'MOD_PERL'} ? \" $ENV{'MOD_PERL'}\" : '';\n \tprint <<EOF;\n <?xml version=\"1.0\" encoding=\"utf-8\"?>\n-<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n+<!DOCTYPE html [\n+\t<!ENTITY nbsp \"&#xA0;\">\n+\t<!ENTITY sdot \"&#x22C5;\">\n+]>\n <html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en-US\" lang=\"en-US\">\n <!-- git web interface version $version, (C) 2005-2006, Kay Sievers <kay.sievers\\@vrfy.org>, Christian Gierke -->\n <!-- git core binaries version $git_version -->\ndiff --git a/t/t9502-gitweb-standalone-parse-output.sh b/t/t9502-gitweb-standalone-parse-output.sh\nindex 8cb582f0e6..81d5625557 100755\n--- a/t/t9502-gitweb-standalone-parse-output.sh\n+++ b/t/t9502-gitweb-standalone-parse-output.sh\n@@ -220,4 +220,18 @@ test_expect_success 'no http-equiv=\"content-type\" in XHTML' '\n \tno_http_equiv_content_type \"p=.git;a=tree\"\n '\n \n+proper_doctype() {\n+\tgitweb_run \"$@\" &&\n+\tgrep -F \"<!DOCTYPE html [\" gitweb.body &&\n+\tgrep \"<!ENTITY nbsp\" gitweb.body &&\n+\tgrep \"<!ENTITY sdot\" gitweb.body\n+}\n+\n+test_expect_success 'Proper DOCTYPE with entity declarations' '\n+\tproper_doctype &&\n+\tproper_doctype \"p=.git\" &&\n+\tproper_doctype \"p=.git;a=log\" &&\n+\tproper_doctype \"p=.git;a=tree\"\n+'\n+\n test_done\n-- \n2.36.1\n\n"},{"id":"456473","messageId":"YpgHUm93840oBtib@camp.crustytoothpaste.net","threadId":"57938","inReplyTo":"20220601012647.1439480-1-jason@jasonyundt.email","subject":"Re: [PATCH] gitweb: switch to a modern DOCTYPE","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2022-06-02T00:41:54Z","receivedAt":"2022-06-02T00:42:00Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2022-06-01 at 01:26:47, Jason Yundt wrote:\n> According to the HTML Standard FAQ:\n> \n> \t“What is the DOCTYPE for modern HTML documents?\n> \n> \tIn text/html documents:\n> \n> \t\t<!DOCTYPE html>\n> \n> \tIn documents delivered with an XML media type: no DOCTYPE is required\n> \tand its use is generally unnecessary. However, you may use one if you\n> \twant (see the following question). Note that the above is well-formed\n> \tXML.”\n> \n> \tSource: [1]\n> \n> Gitweb uses an XHTML 1.0 DOCTYPE:\n> \n> \t<!DOCTYPE html PUBLIC\n> \t\"-//W3C//DTD XHTML 1.0 Strict//EN\"\n> \t\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n> \n> While that DOCTYPE is still valid [2], it has several disadvantages:\n> \n> 1. It’s misleading. The DTD that browsers are supposed to use with that\n>    DOCTYPE has nothing to do with XHTML 1.0 and isn’t available at the URL\n>    that is given [2].\n\nWhile the WHATWG may claim that, an XML parser is absolutely within its\nrights to refer to and use that DTD, and in fact should do so unless its\ncatalog directs it elsewhere.  It may be that some browsers use an\ninternal catalog that refers to a different DTD, however.\n\n> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n> index 606b50104c..1835487ab2 100755\n> --- a/gitweb/gitweb.perl\n> +++ b/gitweb/gitweb.perl\n> @@ -4219,7 +4219,10 @@ sub git_header_html {\n>  \tmy $mod_perl_version = $ENV{'MOD_PERL'} ? \" $ENV{'MOD_PERL'}\" : '';\n>  \tprint <<EOF;\n>  <?xml version=\"1.0\" encoding=\"utf-8\"?>\n> -<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n> +<!DOCTYPE html [\n> +\t<!ENTITY nbsp \"&#xA0;\">\n> +\t<!ENTITY sdot \"&#x22C5;\">\n> +]>\n\nI think this should be fine.  It defines the entities we need and\nappears to be valid XML.  I don't think there should be any problem\nupgrading to XHTML 5 here.\n-- \nbrian m. carlson (he/him or they/them)\nToronto, Ontario, CA\n"},{"id":"456477","messageId":"xmqqa6avppci.fsf@gitster.g","threadId":"57938","inReplyTo":"YpgHUm93840oBtib@camp.crustytoothpaste.net","subject":"Re: [PATCH] gitweb: switch to a modern DOCTYPE","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-06-02T06:10:53Z","receivedAt":"2022-06-02T06:11:01Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"brian m. carlson\" <sandals@crustytoothpaste.net> writes:\n\n>> While that DOCTYPE is still valid [2], it has several disadvantages:\n>> \n>> 1. It’s misleading. The DTD that browsers are supposed to use with that\n>>    DOCTYPE has nothing to do with XHTML 1.0 and isn’t available at the URL\n>>    that is given [2].\n>\n> While the WHATWG may claim that, an XML parser is absolutely within its\n> rights to refer to and use that DTD, and in fact should do so unless its\n> catalog directs it elsewhere.  It may be that some browsers use an\n> internal catalog that refers to a different DTD, however.\n>\n>> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n>> index 606b50104c..1835487ab2 100755\n>> --- a/gitweb/gitweb.perl\n>> +++ b/gitweb/gitweb.perl\n>> @@ -4219,7 +4219,10 @@ sub git_header_html {\n>>  \tmy $mod_perl_version = $ENV{'MOD_PERL'} ? \" $ENV{'MOD_PERL'}\" : '';\n>>  \tprint <<EOF;\n>>  <?xml version=\"1.0\" encoding=\"utf-8\"?>\n>> -<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n>> +<!DOCTYPE html [\n>> +\t<!ENTITY nbsp \"&#xA0;\">\n>> +\t<!ENTITY sdot \"&#x22C5;\">\n>> +]>\n>\n> I think this should be fine.  It defines the entities we need and\n> appears to be valid XML.  I don't think there should be any problem\n> upgrading to XHTML 5 here.\n\nOK, so in short, the patch text looks OK and the proposed log\nmessage needs a bit more work?\n\nThanks.\n\n\n"},{"id":"456479","messageId":"530f7bb4-9f12-f681-0188-878054c4efbf@gmail.com","threadId":"57938","inReplyTo":"20220601012647.1439480-1-jason@jasonyundt.email","subject":"Re: [PATCH] gitweb: switch to a modern DOCTYPE","fromName":"Bagas Sanjaya","fromEmail":"bagasdotme@gmail.com","sentAt":"2022-06-02T07:26:43Z","receivedAt":"2022-06-02T07:26:58Z","isPatch":true,"sender":{"key":"bagasdotme@gmail.com","avatar":"https://avatars.githubusercontent.com/u/40219486?v=4"},"body":"On 6/1/22 08:26, Jason Yundt wrote:\n> According to the HTML Standard FAQ:\n> \n> \t“What is the DOCTYPE for modern HTML documents?\n> \n> \tIn text/html documents:\n> \n> \t\t<!DOCTYPE html>\n> \n> \tIn documents delivered with an XML media type: no DOCTYPE is required\n> \tand its use is generally unnecessary. However, you may use one if you\n> \twant (see the following question). Note that the above is well-formed\n> \tXML.”\n> \n> \tSource: [1]\n> \n> Gitweb uses an XHTML 1.0 DOCTYPE:\n> \n> \t<!DOCTYPE html PUBLIC\n> \t\"-//W3C//DTD XHTML 1.0 Strict//EN\"\n> \t\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n> \n> While that DOCTYPE is still valid [2], it has several disadvantages:\n> \n> 1. It’s misleading. The DTD that browsers are supposed to use with that\n>    DOCTYPE has nothing to do with XHTML 1.0 and isn’t available at the URL\n>    that is given [2].\n> 2. It’s obsolete. XHTML 1.0 was last revised in 2002 and was superseded in\n>    2018 [3].\n> 3. It’s unreliable. Gitweb uses &nbsp; and &sdot; but lets an external file\n>    define them. “[…U]using entity references for characters in XML documents\n>    is unsafe if they are defined in an external file (except for &lt;, &gt;,\n>    &amp;, &quot;, and &apos;).” [4]\n> \n> [1]: <https://github.com/whatwg/html/blob/main/FAQ.md#what-is-the-doctype-for-modern-html-documents>\n> [2]: <https://html.spec.whatwg.org/multipage/xhtml.html#parsing-xhtml-documents>\n> [3]: <https://www.w3.org/TR/xhtml1/#xhtml>\n> [4]: <https://html.spec.whatwg.org/multipage/xhtml.html#writing-xhtml-documents>\n> \n> Signed-off-by: Jason Yundt <jason@jasonyundt.email>\n\nSo basically what this patch does is switch to HTML5, right? That is because\nI can see DOCTYPE \"upgrade\" to use \"<!DOCTYPE html>\", which is the DOCTYPE\nfor HTML5. If it does, then mention HTML5 in v2.\n\n-- \nAn old man doll... just what I always wanted! - Clara\n"},{"id":"456491","messageId":"20220602114305.5915-1-jason@jasonyundt.email","threadId":"57938","inReplyTo":"20220601012647.1439480-1-jason@jasonyundt.email","subject":"[PATCH v2] gitweb: switch to an XHTML5 DOCTYPE","fromName":"Jason Yundt","fromEmail":"jason@jasonyundt.email","sentAt":"2022-06-02T11:43:05Z","receivedAt":"2022-06-02T11:43:59Z","isPatch":true,"sender":{"key":"jason@jasonyundt.email","avatar":"https://avatars.githubusercontent.com/u/5579359?v=4"},"body":"According to the HTML Standard FAQ:\n\n\t“What is the DOCTYPE for modern HTML documents?\n\n\tIn text/html documents:\n\n\t\t<!DOCTYPE html>\n\n\tIn documents delivered with an XML media type: no DOCTYPE is required\n\tand its use is generally unnecessary. However, you may use one if you\n\twant (see the following question). Note that the above is well-formed\n\tXML.”\n\n\tSource: [1]\n\nGitweb uses an XHTML 1.0 DOCTYPE:\n\n\t<!DOCTYPE html PUBLIC\n\t\"-//W3C//DTD XHTML 1.0 Strict//EN\"\n\t\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n\nWhile that DOCTYPE is still valid [2], it has several disadvantages:\n\n1. It’s misleading. If an XML parser uses the DTD at the given link,\n   then the entities &nbsp; and &sdot; won’t get declared. Instead, the\n   parser has to use a DTD from the HTML Standard that has nothing to do\n   with XHTML 1.0 [2].\n2. It’s obsolete. XHTML 1.0 was last revised in 2002 and was superseded in\n   2018 [3].\n3. It’s unreliable. Gitweb uses &nbsp; and &sdot; but lets an external file\n   define them. “[…U]using entity references for characters in XML documents\n   is unsafe if they are defined in an external file (except for &lt;, &gt;,\n   &amp;, &quot;, and &apos;).” [4]\n\n[1]: <https://github.com/whatwg/html/blob/main/FAQ.md#what-is-the-doctype-for-modern-html-documents>\n[2]: <https://html.spec.whatwg.org/multipage/xhtml.html#parsing-xhtml-documents>\n[3]: <https://www.w3.org/TR/xhtml1/#xhtml>\n[4]: <https://html.spec.whatwg.org/multipage/xhtml.html#writing-xhtml-documents>\n\nSigned-off-by: Jason Yundt <jason@jasonyundt.email>\n---\nCompared to the first version of this patch, this version:\n1. makes it clear that XML parsers may used the linked DTD like brian\n   mentioned.\n2. mentions HTML5 like Bagas suggested.\n\n gitweb/gitweb.perl                        |  5 ++++-\n t/t9502-gitweb-standalone-parse-output.sh | 14 ++++++++++++++\n 2 files changed, 18 insertions(+), 1 deletion(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 606b50104c..1835487ab2 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -4219,7 +4219,10 @@ sub git_header_html {\n \tmy $mod_perl_version = $ENV{'MOD_PERL'} ? \" $ENV{'MOD_PERL'}\" : '';\n \tprint <<EOF;\n <?xml version=\"1.0\" encoding=\"utf-8\"?>\n-<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n+<!DOCTYPE html [\n+\t<!ENTITY nbsp \"&#xA0;\">\n+\t<!ENTITY sdot \"&#x22C5;\">\n+]>\n <html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en-US\" lang=\"en-US\">\n <!-- git web interface version $version, (C) 2005-2006, Kay Sievers <kay.sievers\\@vrfy.org>, Christian Gierke -->\n <!-- git core binaries version $git_version -->\ndiff --git a/t/t9502-gitweb-standalone-parse-output.sh b/t/t9502-gitweb-standalone-parse-output.sh\nindex 8cb582f0e6..81d5625557 100755\n--- a/t/t9502-gitweb-standalone-parse-output.sh\n+++ b/t/t9502-gitweb-standalone-parse-output.sh\n@@ -220,4 +220,18 @@ test_expect_success 'no http-equiv=\"content-type\" in XHTML' '\n \tno_http_equiv_content_type \"p=.git;a=tree\"\n '\n \n+proper_doctype() {\n+\tgitweb_run \"$@\" &&\n+\tgrep -F \"<!DOCTYPE html [\" gitweb.body &&\n+\tgrep \"<!ENTITY nbsp\" gitweb.body &&\n+\tgrep \"<!ENTITY sdot\" gitweb.body\n+}\n+\n+test_expect_success 'Proper DOCTYPE with entity declarations' '\n+\tproper_doctype &&\n+\tproper_doctype \"p=.git\" &&\n+\tproper_doctype \"p=.git;a=log\" &&\n+\tproper_doctype \"p=.git;a=tree\"\n+'\n+\n test_done\n-- \n2.36.1\n\n"},{"id":"456538","messageId":"xmqqv8tinblc.fsf@gitster.g","threadId":"57938","inReplyTo":"20220602114305.5915-1-jason@jasonyundt.email","subject":"Re: [PATCH v2] gitweb: switch to an XHTML5 DOCTYPE","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-06-02T18:50:55Z","receivedAt":"2022-06-02T18:51:02Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jason Yundt <jason@jasonyundt.email> writes:\n\n> Subject: Re: [PATCH v2] gitweb: switch to an XHTML5 DOCTYPE\n>\n> According to the HTML Standard FAQ:\n>\n> \t“What is the DOCTYPE for modern HTML documents?\n> ...\n> Compared to the first version of this patch, this version:\n> 1. makes it clear that XML parsers may used the linked DTD like brian\n>    mentioned.\n> 2. mentions HTML5 like Bagas suggested.\n\nSo, is it XHTML5, or HTML5, we want to see on the title?\n\n> +proper_doctype() {\n> +\tgitweb_run \"$@\" &&\n> +\tgrep -F \"<!DOCTYPE html [\" gitweb.body &&\n> +\tgrep \"<!ENTITY nbsp\" gitweb.body &&\n> +\tgrep \"<!ENTITY sdot\" gitweb.body\n> +}\n\nHmph, this test does not care what other cruft appears in the file,\ndoes not care in what order the three lines that match the patterns\nappear, and the second and third patterns are even allowed to match\nthe same line.  I think that is OK (we do not even mind if the two\nENTITY definitions get squashed on the same line).\n\n> +test_expect_success 'Proper DOCTYPE with entity declarations' '\n> +\tproper_doctype &&\n> +\tproper_doctype \"p=.git\" &&\n> +\tproper_doctype \"p=.git;a=log\" &&\n> +\tproper_doctype \"p=.git;a=tree\"\n> +'\n\nAs far as I can tell, git_header_html() is the only helper that\ndeals with DOCTYPE, and responses to any request must call\ngit_header_html() to produce the header (or the handler for a\nparticular request type is buggy), but I do not think it is part of\nthis topic's job to ensure that all request handlers call the\ngit_header_html().  So we _could_ do with just a single test without\ntrying different request types if we wanted to, as long as there are\nexisting tests that make sure everybody uses git_header_html().\n\nWas there a particular reason why these four requests were chosen?\nDo they have different entry points and show the doctype from\ndifferent codepath?\n\nThanks.\n"},{"id":"456539","messageId":"3180470.44csPzL39Z@jason-lemur-pro","threadId":"57938","inReplyTo":"xmqqv8tinblc.fsf@gitster.g","subject":"Re: [PATCH v2] gitweb: switch to an XHTML5 DOCTYPE","fromName":"Jason Yundt","fromEmail":"jason@jasonyundt.email","sentAt":"2022-06-02T19:51:38Z","receivedAt":"2022-06-02T19:52:38Z","isPatch":true,"sender":{"key":"jason@jasonyundt.email","avatar":"https://avatars.githubusercontent.com/u/5579359?v=4"},"body":"On Thursday, June 2, 2022 2:50:55 PM EDT Junio C Hamano wrote:\n> Jason Yundt <jason@jasonyundt.email> writes:\n> > Subject: Re: [PATCH v2] gitweb: switch to an XHTML5 DOCTYPE\n> > \n> > According to the HTML Standard FAQ:\n> > \t“What is the DOCTYPE for modern HTML documents?\n> > \n> > ...\n> > Compared to the first version of this patch, this version:\n> > 1. makes it clear that XML parsers may used the linked DTD like brian\n> > \n> >    mentioned.\n> > \n> > 2. mentions HTML5 like Bagas suggested.\n> \n> So, is it XHTML5, or HTML5, we want to see on the title?\n\nI chose XHTML5 since I didn’t think that it was accurate to say “HTML5 \nDOCTYPE”. The DOCTYPE that this patch uses is valid in the XML syntax, but not \nthe HTML syntax.\n\n> > +proper_doctype() {\n> > +\tgitweb_run \"$@\" &&\n> > +\tgrep -F \"<!DOCTYPE html [\" gitweb.body &&\n> > +\tgrep \"<!ENTITY nbsp\" gitweb.body &&\n> > +\tgrep \"<!ENTITY sdot\" gitweb.body\n> > +}\n> \n> Hmph, this test does not care what other cruft appears in the file,\n> does not care in what order the three lines that match the patterns\n> appear, and the second and third patterns are even allowed to match\n> the same line.  I think that is OK (we do not even mind if the two\n> ENTITY definitions get squashed on the same line).\n\nWhile I was writing this patch, I was thinking something similar. Grep is not \na good tool for validating (X)HTML. I thought about creating a test that uses \nthe Nu Html Checker [1] to validate pages that Gitweb generates, but I decided \nthat that should be the topic of a separate patch.\n\n> > +test_expect_success 'Proper DOCTYPE with entity declarations' '\n> > +\tproper_doctype &&\n> > +\tproper_doctype \"p=.git\" &&\n> > +\tproper_doctype \"p=.git;a=log\" &&\n> > +\tproper_doctype \"p=.git;a=tree\"\n> > +'\n> \n> As far as I can tell, git_header_html() is the only helper that\n> deals with DOCTYPE, and responses to any request must call\n> git_header_html() to produce the header (or the handler for a\n> particular request type is buggy), but I do not think it is part of\n> this topic's job to ensure that all request handlers call the\n> git_header_html().  So we _could_ do with just a single test without\n> trying different request types if we wanted to, as long as there are\n> existing tests that make sure everybody uses git_header_html().\n> \n> Was there a particular reason why these four requests were chosen?\n> Do they have different entry points and show the doctype from\n> different codepath?\n\nNot really. When I created a262585d81 (gitweb: remove invalid http-\nequiv=\"content-type\", 2022-03-08), I chose those requests by running git \ninstaweb and then clicking on the first four links I saw. For this patch, I \njust copied what I had done previously. I don’t know if they use different \ncodepaths (I don’t understand Perl very well).\n\n> Thanks.\n\n[1]: <https://validator.w3.org/nu/>\n\n\n\n"},{"id":"456543","messageId":"YpkwD1op18MY/qBa@camp.crustytoothpaste.net","threadId":"57938","inReplyTo":"xmqqv8tinblc.fsf@gitster.g","subject":"Re: [PATCH v2] gitweb: switch to an XHTML5 DOCTYPE","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2022-06-02T21:47:59Z","receivedAt":"2022-06-02T21:48:07Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2022-06-02 at 18:50:55, Junio C Hamano wrote:\n> Jason Yundt <jason@jasonyundt.email> writes:\n> \n> > Subject: Re: [PATCH v2] gitweb: switch to an XHTML5 DOCTYPE\n> >\n> > According to the HTML Standard FAQ:\n> >\n> > \t“What is the DOCTYPE for modern HTML documents?\n> > ...\n> > Compared to the first version of this patch, this version:\n> > 1. makes it clear that XML parsers may used the linked DTD like brian\n> >    mentioned.\n> > 2. mentions HTML5 like Bagas suggested.\n> \n> So, is it XHTML5, or HTML5, we want to see on the title?\n\nIt's XHTML 5.  Technically, it's the XML syntax of HTML 5, so I don't\nthink we care much about the nit here.\n\n> > +proper_doctype() {\n> > +\tgitweb_run \"$@\" &&\n> > +\tgrep -F \"<!DOCTYPE html [\" gitweb.body &&\n> > +\tgrep \"<!ENTITY nbsp\" gitweb.body &&\n> > +\tgrep \"<!ENTITY sdot\" gitweb.body\n> > +}\n> \n> Hmph, this test does not care what other cruft appears in the file,\n> does not care in what order the three lines that match the patterns\n> appear, and the second and third patterns are even allowed to match\n> the same line.  I think that is OK (we do not even mind if the two\n> ENTITY definitions get squashed on the same line).\n\nYeah, that should be fine because IIRC this syntax isn't going to be\nallowed elsewhere in the file.  If it did appear elsewhere, then the\nuser would receive an XML parsing error.\n\nWe _could_ make this check for beginning of file, the XML declaration,\nand then the specified lines (e.g., with head(1)), but I don't really\nthink that's necessary. We should be fine here for now, and if we decide\nwe need that in the future, we can add it.  I'd be happy with this as it\nstands.\n-- \nbrian m. carlson (he/him or they/them)\nToronto, Ontario, CA\n"},{"id":"456545","messageId":"xmqqmteuiuos.fsf@gitster.g","threadId":"57938","inReplyTo":"YpkwD1op18MY/qBa@camp.crustytoothpaste.net","subject":"Re: [PATCH v2] gitweb: switch to an XHTML5 DOCTYPE","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-06-02T22:09:39Z","receivedAt":"2022-06-02T22:09:45Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"brian m. carlson\" <sandals@crustytoothpaste.net> writes:\n\n>> > Subject: Re: [PATCH v2] gitweb: switch to an XHTML5 DOCTYPE\n>> ...\n>> > 2. mentions HTML5 like Bagas suggested.\n>> \n>> So, is it XHTML5, or HTML5, we want to see on the title?\n>\n> It's XHTML 5.  Technically, it's the XML syntax of HTML 5, so I don't\n> think we care much about the nit here.\n\nI too don't care either way very much.\n\nI just noticed the discrepancy between the title and the body, but\nthe mention of HTML5 is after the three-dash lines so nobody gets\nhurt anyway ;-)\n\n> We _could_ make this check for beginning of file, the XML declaration,\n> and then the specified lines (e.g., with head(1)), but I don't really\n> think that's necessary. We should be fine here for now, and if we decide\n> we need that in the future, we can add it.  I'd be happy with this as it\n> stands.\n\nYup, thanks for sanity checking.\n\nWill queue.\n"}]}