Ticket #6515 (closed defect (bug): duplicate)

Opened 4 years ago

Last modified 3 years ago

Gallery shortcode produces invalid XHTML, in all cases

Reported by: asiah Owned by: anonymous
Priority: normal Milestone:
Component: Gallery Version: 2.5
Severity: normal Keywords:
Cc:

Description

Note: I use Firefox 2.0.0.13 and the Web Developer Plugin's validation tools.

I made note of this at the WP-Testers mailing list, but as of a few minutes ago, no one has responded to my comment. The silence has revealed to me two things.

The Dashboard no longer validates according to XHTML standards. It's petty, but it might solve some of the other issues that have cropped up by correcting it.

Inserting individual images into a post is flawless, posing no threat to validation, whereas inserting a gallery reveals issues with missing alt attributes, unclosed br tags, and misplaced style elements (<style type='text/css'>...).

I hope this issue can be addressed soon as I've been awaiting the arrival of the Gallery feature for quite some time. If not, how can I fix this at a local level, perhaps in some WP system file? Thanks so much for your assistance.

If you require a hands on look, check out the following post.  http://www.evitae.net/archives/2008/03/31/wordpress-25/

Change History

comment:1 follow-up: ↓ 2   ionfish4 years ago

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

Duplicate of #6461 and #6496.

comment:2 in reply to: ↑ 1   asiah4 years ago

  • Status changed from closed to reopened
  • Resolution duplicate deleted

Replying to ionfish:

Duplicate of #6461 and #6496.

Thanks for the speedy update. I was able to make all of these work, except one extraneous <p> tag continued to remain until I surrounded the [gallery] shortcode with a meaningless empty <div> as follows: <div>[gallery]</div>

This fix may not be as apparent to others, and I am concerned that perhaps I might have overlooked something that might have addressed this issue. I doubt it, as I've completed the process a dozen times, comparing files and all. If anyone could be so kind as to point me in the right direction, I would be most appreciative.

  • Milestone set to 2.6
  • Status changed from reopened to closed
  • Resolution set to duplicate
  • Milestone 2.6 deleted

markjaquith is dealing with this in a wpautop() ticket: #6444.

comment:5 follow-up: ↓ 6   Otto424 years ago

  • Status changed from closed to reopened
  • Summary changed from WP 2.5 Gallery Insertion Causes Invalidation to Gallery shortcode produces invalid XHTML, in all cases
  • Resolution duplicate deleted
  • Milestone set to 2.7

This never got dealt with in #6444, the gallery is *still* producing invalid XHTML, everywhere it's being used.

STYLE tags are not allowed in the main BODY. They can only be in the HEAD.

Are there any plans to fix this? The gallery is basically unusable because of this sort of thing.

comment:6 in reply to: ↑ 5   TurtleOfDoom3 years ago

  • Keywords gallery, style, css added

Replying to Otto42:

This never got dealt with in #6444, the gallery is *still* producing invalid XHTML, everywhere it's being used.

STYLE tags are not allowed in the main BODY. They can only be in the HEAD.

Are there any plans to fix this? The gallery is basically unusable because of this sort of thing.

Agreed, this is a bug that has to be fixed.

This problem is mentioned in #6618, #6380, and #6927, but it needs a separate report of it's own. There is a patch attached to #6380 that purports to fix this, but it is an ugly solution and that patch won't apply to the current code base. That report also doesn't explicitly address this issue.

Any ideas? This is still a serious problem as it's producing invalid code. I've looked at it, but I'm not sure what the correct solution is.

I think we should simply rip the style out of the gallery code and put it in the theme's CSS, where it belongs.

comment:8   ryan3 years ago

  • Component changed from General to Gallery

My muli-gallery support ticket #7607 has XHTML 1.0 fix for the shortcode if it needs to be used. It puts the Gallery code inside the .css files.

  • Status changed from reopened to closed
  • Resolution set to duplicate
  • Milestone 2.7 deleted
  • Keywords gallery, style, css removed
Note: See TracTickets for help on using tickets.