git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] gitweb: switch to an XHTML5 DOCTYPE

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 2, 2022, 18:50 UTC
Message-ID
<xmqqv8tinblc.fsf@gitster.g>
In-Reply-To
<20220602114305.5915-1-jason@jasonyundt.email>
Jason Yundt <jason@jasonyundt.email> writes:
Show 10 quoted lines
> Subject: Re: [PATCH v2] gitweb: switch to an XHTML5 DOCTYPE
>
> According to the HTML Standard FAQ:
>
> 	“What is the DOCTYPE for modern HTML documents?
> ...
> Compared to the first version of this patch, this version:
> 1. makes it clear that XML parsers may used the linked DTD like brian
>    mentioned.
> 2. mentions HTML5 like Bagas suggested.
So, is it XHTML5, or HTML5, we want to see on the title?
Show 6 quoted lines
> +proper_doctype() {
> +	gitweb_run "$@" &&
> +	grep -F "<!DOCTYPE html [" gitweb.body &&
> +	grep "<!ENTITY nbsp" gitweb.body &&
> +	grep "<!ENTITY sdot" gitweb.body
> +}

Hmph, this test does not care what other cruft appears in the file, does not care in what order the three lines that match the patterns appear, and the second and third patterns are even allowed to match the same line. I think that is OK (we do not even mind if the two ENTITY definitions get squashed on the same line).

Show 6 quoted lines
> +test_expect_success 'Proper DOCTYPE with entity declarations' '
> +	proper_doctype &&
> +	proper_doctype "p=.git" &&
> +	proper_doctype "p=.git;a=log" &&
> +	proper_doctype "p=.git;a=tree"
> +'

As far as I can tell, git_header_html() is the only helper that deals with DOCTYPE, and responses to any request must call git_header_html() to produce the header (or the handler for a particular request type is buggy), but I do not think it is part of this topic's job to ensure that all request handlers call the git_header_html(). So we _could_ do with just a single test without trying different request types if we wanted to, as long as there are existing tests that make sure everybody uses git_header_html().

Was there a particular reason why these four requests were chosen? Do they have different entry points and show the doctype from different codepath?

Thanks.
Previous: Jason YundtNext: Jason Yundt
Message 6 of 9 in “gitweb: switch to a modern DOCTYPE”
  1. gitweb: switch to a modern DOCTYPEJason Yundt, Jun 1, 2022
  2. brian m. carlsonJun 2, 2022
  3. Junio C HamanoJun 2, 2022
  4. Bagas SanjayaJun 2, 2022
  5. gitweb: switch to an XHTML5 DOCTYPEJason Yundt, Jun 2, 2022
  6. Junio C HamanoJun 2, 2022
  7. Jason YundtJun 2, 2022
  8. brian m. carlsonJun 2, 2022
  9. Junio C HamanoJun 2, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.