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

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

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Jun 2, 2022, 21:47 UTC
Message-ID
<YpkwD1op18MY/qBa@camp.crustytoothpaste.net>
In-Reply-To
<xmqqv8tinblc.fsf@gitster.g>
On 2022-06-02 at 18:50:55, Junio C Hamano wrote:
Show 14 quoted lines
> Jason Yundt <jason@jasonyundt.email> writes:
> 
> > 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?

It's XHTML 5. Technically, it's the XML syntax of HTML 5, so I don't think we care much about the nit here.

Show 12 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).

Yeah, that should be fine because IIRC this syntax isn't going to be allowed elsewhere in the file. If it did appear elsewhere, then the user would receive an XML parsing error.

We _could_ make this check for beginning of file, the XML declaration, and then the specified lines (e.g., with head(1)), but I don't really think that's necessary. We should be fine here for now, and if we decide we need that in the future, we can add it. I'd be happy with this as it stands.

-- 
brian m. carlson (he/him or they/them)
Toronto, Ontario, CA
Previous: Jason YundtNext: Junio C Hamano
Message 8 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.