Ticket #6461 (closed defect (bug): fixed)

Opened 4 years ago

Last modified 4 years ago

Generated Gallery markup is invalid

Reported by: shelleyp Owned by: 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 Download (708 bytes) - added by Nazgul 4 years ago.

Change History

  • Component changed from Optimization to Template

Nazgul4 years ago

comment:2 follow-up: ↓ 5   Nazgul4 years ago

  • Keywords has-patch added
  • 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.

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

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

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

comment:5 in reply to: ↑ 2   shelleyp4 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.

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