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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2022-06-02 at 18:50:55, Junio C Hamano wrote:
> 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.

> > +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

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux