Text_Wiki
[ class tree: Text_Wiki ] [ index: Text_Wiki ] [ all elements ]

Source for file Raw.php

Documentation is available at Raw.php

  1. <?php
  2.  
  3. /**
  4.  *
  5.  * Parses for monospaced inline text.
  6.  *
  7.  * @category Text
  8.  *
  9.  * @package Text_Wiki
  10.  *
  11.  * @author Tomaiuolo Michele <tomamic@yahoo.it>
  12.  *
  13.  * @license LGPL
  14.  *
  15.  * @version $Id: Raw.php 242165 2007-09-04 19:43:07Z mic $
  16.  *
  17.  */
  18.  
  19. class Text_Wiki_Parse_Raw extends Text_Wiki_Parse {
  20.  
  21.  
  22.     /**
  23.      *
  24.      * The regular expression used to parse the source text and find
  25.      * matches conforming to this rule.  Used by the parse() method.
  26.      *
  27.      * @access public
  28.      *
  29.      * @var string 
  30.      *
  31.      * @see parse()
  32.      *
  33.      */
  34.  
  35.     var $regex = '/~(_|[^ \w\n])/';
  36.  
  37.     /**
  38.      *
  39.      * Generates a replacement for the matched text.  Token options are:
  40.      *
  41.      * 'type' => ['start'|'end'] The starting or ending point of the
  42.      * monospaced text.  The text itself is encapsulated into a Raw token.
  43.      *
  44.      * @access public
  45.      *
  46.      * @param array &$matches The array of matches from parse().
  47.      *
  48.      * @return string A token to be used as a placeholder
  49.      *  in the source text for the preformatted text.
  50.      *
  51.      */
  52.  
  53.     function process(&$matches)
  54.     {
  55.         return $this->wiki->addToken(
  56.             $this->rule,
  57.             array('text' => $matches[1]'type' => 'escape')
  58.         );
  59.     }
  60. }
  61. ?>

Documentation generated on Mon, 11 Mar 2019 15:40:31 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.