[Pmwiki-users] Wikify(anythingi)

Steven Leite steven_leite
Thu May 20 03:28:36 CDT 2004


Hello (anyone with RegExp knowledge),

Is there a simple way to convert any string in to a valid WikiWord (or
valid {{Free Link}} word) suitable for using as a $Title on a WikiPage?

Here's what I have so far:

function Wikify($str)
{
  $str =
  $str =                  // a bunch of ereg_replace(   )  statements to
  $str =                  // strip out any unwated characters, or
possibly
  $str =                  // make substitutions.
  $str =
  return $str;          // Returns the word, Wikified, suitable to be
used in a $Title
}

In my case, $str would be a filename.  IT would be nice if we could
somehow utilize the existing $Page / $Group / $WikiWord / $FreeLink
(Patterns).  That way if those patterns every change, this function
would still function. =)

If you can spare a moment.

Thanks,

-Steven




More information about the pmwiki-users mailing list