Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#42010 closed defect (bug) (duplicate)

Native image widget target attribute issue

Reported by: jordanwebdev's profile jordanwebdev Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.8.2
Component: Widgets Keywords:
Focuses: accessibility Cc:

Description

The newly introduced image widget automatically adds an empty target attribute to the img element that it generates. However, this causes a validation error on https://validator.w3.org. The attribute should not be automatically added, unless specified to do so.

Change History (4)

#1 in reply to: ↑ description @jordanwebdev
7 years ago

I meant to say that the empty target attribute gets added to the link tag that gets generated when the image is selected to link somewhere, not the img element itself. In my specific case, I've chosen the Custom URL option.

Replying to jordanwebdev:

The newly introduced image widget automatically adds an empty target attribute to the img element that it generates. However, this causes a validation error on https://validator.w3.org. The attribute should not be automatically added, unless specified to do so.

#2 @afercia
7 years ago

@jordanwebdev welcome to Trac! I've just tried to reproduce this with no luck. I get a clean link without any target attribute. Does it still happen with all plugins disabled and a default theme (for example Twenty Seventeen or Twenty Sixteen) activated?

#3 @afercia
7 years ago

  • Keywords reporter-feedback added

#4 @westonruter
7 years ago

  • Keywords reporter-feedback removed
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #41919.

The empty attributes were fixed in r41549.

Note: See TracTickets for help on using tickets.