Drupal 7.23
API 7.x-1.6
Grammar Parser Library 7.x-2.1
Grammar Parser grammar_parser-7.x-2.x-dev.tar.gz


As far as I can tell links containing exclamation marks, such as the Drupal API links, fail.

/**
 * @link https://api.drupal.org/api/drupal/modules!block!block.api.php/function/hook_block_view/7 hook_block_view($delta) @endlink
 * 
 */

Gives (unlinked, plain text:
hook_block_view($delta)

I have tried various delimeters (such as quoting the URL with "" or ''), no effect.

I have tried surrounding the entire @end .. @ endlink with pregular expression boundary markers such as '!' or '\' or '/' as suggested at #203645: Links not being created, does not help.

I have searched the API issues and found nothing else related. If there is a documented solution please refer me to it and convert this to a support request.

Comments

jhodgdon’s picture

Normally you should not need an @link there. Just put the function name hook_block_view($delta) and it will turn into a link automatically -- no @link/@endlink is needed.

That said, this is still a bug in the API module and the reason is that the regular expression in function api_format_documentation in parser.inc that takes care of @link tags with full URLs does not have the ! character in it. This is at line 1105 in the current 7.x dev version.

Thanks for reporting this issue!

jhodgdon’s picture

Status: Active » Fixed

I believe this is now fixed in the dev version of the API module.

webel’s picture

Thanks for your reply and fix attempt. I installed http://ftp.drupal.org/files/projects/api-7.x-1.x-dev.tar.gz from 2014-Feb-07 (7.x-1.6+7-dev) but it still seems to fail.

I tried it on the following docs (reran cron to be sure API docs regenerated):

  /**
   * ..
   *
   * Adapted from @link https://drupal.org/node/1111260 Creating the configuration form @endlink
   * 
   * @link https://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_menu/7 hook_menu() @endlink
   *
   *  ...
   */

And all it shows is:

..

hook_menu()

You can see the result at: http://drupal7demo.webel.com.au/api/ooe/lib!Drupal!ooe!Demo!Module!OoeBr...

Webel

webel’s picture

Status: Fixed » Needs work
webel’s picture

Status: Needs work » Fixed

I tested this again this morning and 7.x-1.6+7-dev worked with:

  /**
   * @link https://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_menu/7 hook_menu() @endlink
   */

I don't know what changed, but this time it caught the code file change and module update ok,

thanks,

Webel

jhodgdon’s picture

Glad it's working this time. No idea what happened the first time.

Status: Fixed » Closed (fixed)

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