5 * Parses for image placement.
11 * @author Paul M. Jones <pmjones@php.net>
15 * @version $Id: Image.php,v 1.3 2005/02/23 17:38:29 pmjones Exp $
21 * Parses for image placement.
27 * @author Paul M. Jones <pmjones@php.net>
31 class Text_Wiki_Parse_Image
extends Text_Wiki_Parse
{
36 * The regular expression used to find source text matching this
45 var $regex = '/(\[\[image )(.+?)(\]\])/i';
50 * Generates a token entry for the matched text. Token options are:
52 * 'src' => The image source, typically a relative path name.
54 * 'opts' => Any macro options following the source.
58 * @param array &$matches The array of matches from parse().
60 * @return A delimited token number to be used as a placeholder in
65 function process(&$matches)
67 $pos = strpos($matches[2], ' ');
74 // everything after the space is attribute arguments
76 'src' => substr($matches[2], 0, $pos),
77 'attr' => $this->getAttrs(substr($matches[2], $pos+
1))
81 return $this->wiki
->addToken($this->rule
, $options);