original_string: protected function link($link, $anchor = "") {
          $link = trim($link);
          if (preg_match("/^(https?|s?ftp):\/\/.+$/i", $link)) {
              $link = trim($link, ",.?!");
              return array('content' => $link, 'url' => $link);
          } else {
              $callbackargs = $this->linkgeneratorcallbackargs;
              $callbackargs['anchor'] = $anchor;
              $link = call_user_func_array($this->linkgeneratorcallback, array($link, $callbackargs));
  
              if (isset($link['link_info'])) {
                  $l = $link['link_info']['link'];
                  unset($link['link_info']['link']);
                  $this->returnvalues['link_count'][$l] = $link['link_info'];
              }
              return $link;
          }
      }
code: protected function link($link, $anchor = "") {
          $link = trim($link);
          if (preg_match("/^(https?|s?ftp):\/\/.+$/i", $link)) {
              $link = trim($link, ",.?!");
              return array('content' => $link, 'url' => $link);
          } else {
              $callbackargs = $this->linkgeneratorcallbackargs;
              $callbackargs['anchor'] = $anchor;
              $link = call_user_func_array($this->linkgeneratorcallback, array($link, $callbackargs));
  
              if (isset($link['link_info'])) {
                  $l = $link['link_info']['link'];
                  unset($link['link_info']['link']);
                  $this->returnvalues['link_count'][$l] = $link['link_info'];
              }
              return $link;
          }
      }
code_tokens: protected function link ( $ link , $ anchor = "" ) { $ link = trim ( $ link ) ; if ( preg_match ( "/^(https?|s?ftp):\/\/.+$/i" , $ link ) ) { $ link = trim ( $ link , ",.?!" ) ; return array ( 'content' => $ link , 'url' => $ link ) ; } else { $ callbackargs = $ this -> linkgeneratorcallbackargs ; $ callbackargs [ 'anchor' ] = $ anchor ; $ link = call_user_func_array ( $ this -> linkgeneratorcallback , array ( $ link , $ callbackargs ) ) ; if ( isset ( $ link [ 'link_info' ] ) ) { $ l = $ link [ 'link_info' ] [ 'link' ] ; unset ( $ link [ 'link_info' ] [ 'link' ] ) ; $ this -> returnvalues [ 'link_count' ] [ $ l ] = $ link [ 'link_info' ] ; } return $ link ; } }
docstring: Link internal callback
docstring_tokens: Link internal callback