I have the nofollow as the rel attribute on the field form for the content type.

In the link I'm getting:

<a href="[path]" rel=" [my defined class] 1" class="[my defined class]">link</a>

I should be getting:

<a href="[path]" rel="[my defined rel attr]" class="[my defined class]">link</a>

I am using the field in views with the 'title, as link (default)' as the option.
Any ideas?

Comments

mfkahn’s picture

Around line 508 of link.module:


  // Remove the rel=nofollow for internal links.
  if ($type != LINK_EXTERNAL && strpos($item['attributes']['rel'], 'nofollow') !== FALSE) {
    $item['attributes']['rel'] = str_replace('nofollow', '', $item['attributes']);
  }

Should be


  // Remove the rel=nofollow for internal links.
  if ($type != LINK_EXTERNAL && strpos($item['attributes']['rel'], 'nofollow') !== FALSE) {
    $item['attributes']['rel'] = str_replace('nofollow', '', $item['attributes']['rel']);  // <-- CORRECT
  }

The only workaround we could come up with w/o patching this is to not use nofollow when we know the field is going to hold internal links.

This is an important issue if W3C compliance is mandated.