[BUG] cgit W3 validator fail

Daniel Campbell dlcampbell at gmx.com
Sat Oct 20 11:12:33 CEST 2018

On Thu, Oct 18, 2018 at 10:27:29AM +0300, Anast Gramm wrote:
> Hello. I recently got into some html "programming" and found out
> about the w3 validator service https://validator.w3.org/
> Upon running it on a cgit site I own an error occurred:
> > The summary attribute on the table element is obsolete.
> > Consider describing the structure of the table in a caption element
> > or in a figure element containing the table; or, simplify the
> > structure of the table so that no description is needed.
> A quick grep through the code showed some lines containing the obsolete
> html.
> Should the summary attribute be moved into a caption or
> should it be removed all together?

The summary attribute is deprecated in HTML 5. Earlier versions may
still support it. I checked the source on various pages in my cgit
installation and they seem to contain generic information like
"repository info", "repository list", and so on. These same tables
already have CSS classes applied, though one could choose to style the
two differently with CSS(3) rules like:

	table[summary="repository info"] {
		color: #f00;

I wrote two patches to fix this: the first patch simply removes the
"summary='...'" parts, and the second adds classes (where needed) so
that style writers that used the above method to style can still target
the same elements, retaining specificity and shortening their selectors.

I have attached the patches to this e-mail for review.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ui-remove-summary-attribute-from-table-elements.patch
Type: text/x-diff
Size: 4444 bytes
Desc: not available
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20181020/6ac275f6/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-ui-add-classes-to-supplement-missing-summary-info.patch
Type: text/x-diff
Size: 2532 bytes
Desc: not available
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20181020/6ac275f6/attachment-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20181020/6ac275f6/attachment.asc>

More information about the CGit mailing list