I'm using wiki module and it works, ok. Now I'm interesed in adding a feature to allow internal link (like /admin/settings) implemented. Ad far now if I use [ user registration | /user/register ] it is detected as wiki-named in the _wiki_parse_and_link function and the output is /wiki/goto/user/register (it don't works).

Now I suggest to introduce another elseif in the subroutine to detect $URL starting with a "/", then produce a regular link. So now the code:

  if (preg_match("/\.".WIKI_INLINE_IMAGES."$/i", $URL)) {
    // if it's an image, embed it; otherwise, it's a regular link
    $link = array('type' => "image-$linktype", 'link' => _wiki_link_image($URL, $linkname));
  }

// <internal link patch>
  elseif (preg_match("#^/#", $URL)) {
    $link = array('type' => "url-$linktype", 'link' => l($linkname, $URL));
  }
// </internal link patch>
  
  elseif (preg_match("#^".WIKI_ALLOWED_PROTOCOLS.":#", $URL)) {
    $link = array('type' => "url-$linktype", 'link' => _wiki_link_URL($URL, $linkname));
  }

Hoping it works.

ema

Comments

Neil Adair’s picture

Did you try the freelinking module?

Neil