Ticket #6461 (closed defect: fixed)

Opened 3 months ago

Last modified 3 months ago

Generated Gallery markup is invalid

Reported by: shelleyp Assigned to: anonymous
Priority: normal Milestone: 2.5.1
Component: Template Version: 2.5
Severity: normal Keywords: has-patch
Cc:

Description

This is related to another item: http://trac.wordpress.org/ticket/6444.

In addition to the extraneous open paragraph, the generated gallery does not include alt tags (even empty ones), and the BR elements are not properly terminated. Because of these issues the gallery pages don't validate, and cause errors if you try to serve the page as XHTML.

I've made a patch, at http://burningbird.net/php/media.phps.

Attachments

6461.diff (0.7 kB) - added by Nazgul on 03/30/08 09:30:11.

Change History

03/30/08 06:28:36 changed by shelleyp

  • component changed from Optimization to Template.

03/30/08 09:30:11 changed by Nazgul

  • attachment 6461.diff added.

(follow-up: ↓ 5 ) 03/30/08 09:35:05 changed by Nazgul

  • keywords set to has-patch.
  • priority changed from high to normal.
  • severity changed from major to normal.
  • milestone changed from 2.7 to 2.6.

shelleyp, thanks for reporting this issue!

Could you be so kind to attach a .diff file in the future instead of linking to an entire file. That way the core devs don't have to weed through the entire file looking for your changes.

I've just did and have a small question about those changes. Why did you add an alt attribute to the </$captiontag> element?

I've made a .diff file based on your other changes and attached it to the ticket.

03/30/08 16:41:44 changed by markjaquith

  • status changed from new to closed.
  • resolution set to fixed.

(In [7575]) Gallery XHTML validation fixes. props shelleyp. fixes #6461 for trunk

03/30/08 16:42:21 changed by markjaquith

(In [7576]) Gallery XHTML validation fixes. props shelleyp. fixes #6461 for 2.5.1

(in reply to: ↑ 2 ) 04/05/08 04:24:19 changed by shelleyp

Replying to Nazgul:

shelleyp, thanks for reporting this issue! Could you be so kind to attach a .diff file in the future instead of linking to an entire file. That way the core devs don't have to weed through the entire file looking for your changes.

Actually, I didn't really consider this a true patch. A better fix would be to actually add photo information to the alt attribute, but I couldn't take the time to figure out how to access this information in this function. Instead, I just added the empty alt attribute, so the image would validate.

This was more of a demonstration than a formal patch. However, I'll remember the diffs if I formally submit any other changes.

04/15/08 01:43:47 changed by thee17

  • milestone changed from 2.6 to 2.5.1.