WordPress.org

Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#6461 closed defect (bug) (fixed)

Generated Gallery markup is invalid

Reported by: shelleyp Owned by:
Milestone: 2.5.1 Priority: normal
Severity: normal Version: 2.5
Component: Template Keywords: has-patch
Focuses: 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 (1)

6461.diff (708 bytes) - added by Nazgul 11 years ago.

Download all attachments as: .zip

Change History (7)

#1 @shelleyp
11 years ago

  • Component changed from Optimization to Template

@Nazgul
11 years ago

#2 follow-up: @Nazgul
11 years ago

  • Keywords has-patch added
  • Milestone changed from 2.7 to 2.6
  • Priority changed from high to normal
  • Severity changed from major to normal

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.

#3 @markjaquith
11 years ago

  • Resolution set to fixed
  • Status changed from new to closed

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

#4 @markjaquith
11 years ago

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

#5 in reply to: ↑ 2 @shelleyp
11 years ago

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.

#6 @thee17
11 years ago

  • Milestone changed from 2.6 to 2.5.1
Note: See TracTickets for help on using tickets.