API page: http://api.drupal.org/api/drupal/includes--common.inc/function/drupal_at...

Describe the problem you have found:
I think that one should not have to look at the implementation of drupal_attributes() just to determine whether or not it is safe to do

  $xhtml .= '<img' . drupal_attributes($attributes) . '/>';

or not. I.e., someone might assume that they need to instead do:

  $xhtml .= '<img ' . drupal_attributes($attributes) . '/>';

.

CommentFileSizeAuthor
#5 drupal_attributes_doc-1180100-5.patch469 bytesbarbi

Comments

jhodgdon’s picture

Version: 7.x-dev » 8.x-dev
Issue tags: +Novice

Good point. I think this should be added to the @return section of the doc. 8.x first, then backport to 7.x. Good project for a novice doc contributor!

jhodgdon’s picture

Title: Documentation problem with drupal_attributes » drupal_attributes doc should mention the space at beginning of return value
barbi’s picture

Can we just add the below phrase at the end of @return? The @return would become
A string ready for insertion in a tag (starts with a space).

jhodgdon’s picture

Yes, that seems like a perfect solution to me.

barbi’s picture

Assigned: Unassigned » barbi
Status: Active » Needs review
StatusFileSize
new469 bytes
jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs backport to D7

Go barbi! 8.x/7.x please.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x and 7.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.