[wp-trac] [WordPress Trac] #23250: make_clickable is not creating title attribute

WordPress Trac noreply at wordpress.org
Mon Jan 21 15:14:00 UTC 2013


#23250: make_clickable is not creating title attribute
-----------------------------+-------------------------
 Reporter:  Confridin        |       Type:  enhancement
   Status:  new              |   Priority:  normal
Milestone:  Awaiting Review  |  Component:  General
  Version:  3.5              |   Severity:  minor
 Keywords:                   |
-----------------------------+-------------------------
 Hi,

 I discovered the make_clickable function a few time ago. It converts URI,
 www, ftp and email addresses into links. The regex works fine but doesn't
 add the title attribute to the link.

 For exemple, here is a sample texte
 {{{
 this is a text with a link : http://www.website.com
 }}}

 With make_clickable, a link is added :
 {{{
 this is a text with a link : <a
 href="http://www.website.com">http://www.website.com</a>
 }}}

 But a correct html link should contains a title attribute, like this
 {{{
 this is a text with a link : <a href="http://www.website.com"
 title="http://www.website.com">http://www.website.com</a>
 }}}

 The issue comes from those functions (into wp-
 includes/formatting.php[[BR]]
 _make_web_ftp_clickable_cb[[BR]]
 _make_url_clickable_cb[[BR]]
 _make_email_clickable_cb[[BR]]

 '''_make_url_clickable_cb'''[[BR]]
 This code
 {{{
 return $matches[1] . "<a href=\"$url\" rel=\"nofollow\">$url</a>" .
 $suffix;
 }}}
 shoulde be replaced by
 {{{
 return $matches[1] . "<a href=\"$url\" title=\"$url\"
 rel=\"nofollow\">$url</a>" . $suffix;
 }}}

 '''_make_web_ftp_clickable_cb'''[[BR]]
 This code
 {{{
 return $matches[1] . "<a href=\"$dest\" rel=\"nofollow\">$dest</a>$ret";
 }}}
 shoulde be replaced by
 {{{
 return $matches[1] . "<a href=\"$dest\" title=\"$dest\"
 rel=\"nofollow\">$dest</a>$ret";
 }}}

 '''_make_email_clickable_cb'''[[BR]]
 This code
 {{{
 return $matches[1] . "<a href=\"mailto:$email\">$email</a>";
 }}}
 shoulde be replaced by
 {{{
 return $matches[1] . "<a href=\"mailto:$email\"
 title=\"$email\">$email</a>";
 }}}

 Do you think it should be corrected ?

 Regards,

 Daniel Roch.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23250>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list