WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#3841 closed defect (bug) (wontfix)

Wordpress 2.1.1 - Image Upload bug

Reported by: dannyfoo Owned by:
Milestone: Priority: normal
Severity: trivial Version: 2.1.1
Component: Administration Keywords:
Focuses: Cc:

Description

I upgraded to WP 2.1.1 to rid myself of any bugs. But I think I've found one new one.

When I used the WP image upload feature and sent the image to editor. I got this HTML code which is definitely wrong.

<a href='http://www.dannyfoo.com/blog/wp-content/uploads/2006/11/select-dream.jpg' title='Dream User Interface'><img src='http://www.dannyfoo.com/blog/wp-content/uploads/2006/11/select-dream.thumbnail.jpg' alt='Dream User Interface' /></a>

Notice the ' used instead of the " which is the correct code in HTML.

Hope this 'bug' will be fixed because image upload is very important I think to a lot of people.

Cheers.

Change History (4)

comment:1 @rob1n8 years ago

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

Single quotes are perfectly valid in the HTML specification. Though I don't like it personally, it *is* valid.

comment:2 @dannyfoo8 years ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

Okie, so they are 'valid'. But what's semantically correct or proper based on WC3 guidelines?

When you teach a person HTML and to insert an image, by default it's by using " instead of '.

In addition, you expect everyone to now use ' instead of the standard ". In honesty, it's like Wordpress is trying to change the HTML standards by doing this.

I feel this ticket should remain open unless the WP team can clarify their intentions of making people use ' instead of ".

cheers.

comment:3 follow-up: @majelbstoat8 years ago

  • Priority changed from high to normal
  • Severity changed from critical to trivial

[Okie, so they are 'valid'. But what's semantically correct or proper based on WC3 guidelines?]

What's semantically correct is what's valid, no?

[In addition, you expect everyone to now use ' instead of the standard ". In honesty, it's like
Wordpress is trying to change the HTML standards by doing this.]

Slightly overdramatic don't you think? I was going to just close this again, but I did some checking first.

HTML 4 allows single or double quotes:

http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.2.2

XHTML is a bit vague, but would also seem to allow both, considering XHTML is HTML reformatted in XML:

http://www.w3.org/TR/REC-xml/#sec-common-syn

"Literal data is any quoted string not containing the quotation mark used as a delimiter for that string." - indicating that you can use either.

However, consider the fact that this particular attribute is an alt - I could see lots of people wanting to use an apostrophe there, which could conceivably cause minor problems. ie:

<a href='http://mysite.com/wp-content/uploads/2006/11/scooter.jpg' title='Jamie's Scooter'><img src='http://mysite.com/wp-content/uploads/2006/11/scooter.jpg' alt='Jamie's Scooter' /></a>

No longer valid with who knows what results. Either way, it's a minor fix, so it might be worth doing...

comment:4 in reply to: ↑ 3 @rob1n8 years ago

  • Resolution set to wontfix
  • Status changed from reopened to closed

Replying to majelbstoat:

However, consider the fact that this particular attribute is an alt - I could see lots of people wanting to use an apostrophe there, which could conceivably cause minor problems. ie:

<a href='http://mysite.com/wp-content/uploads/2006/11/scooter.jpg' title='Jamie's Scooter'><img src='http://mysite.com/wp-content/uploads/2006/11/scooter.jpg' alt='Jamie's Scooter' /></a>

No longer valid with who knows what results. Either way, it's a minor fix, so it might be worth doing...

I believe wptexturize() is applied to the ALT attribute's value, so the apostrophe would become &#8220; or something like that. Single quotes are *perfectly valid*, and it is often easier to code in PHP. I see no issue, other than the fact that this isn't how people learn how to code HTML.

Note: See TracTickets for help on using tickets.