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

Source for file Preformatted.php

Documentation is available at Preformatted.php

  1. <?php
  2.  
  3. /**
  4.  *
  5.  * Parses for preformatted 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: Preformatted.php,v 1.1 2006/10/23 13:11:27 mic Exp $
  16.  *
  17.  */
  18.  
  19. class Text_Wiki_Parse_Preformatted 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 = '/\n{{{\n(.*)\n}}}\n/Us';
  36.  
  37.     /**
  38.      *
  39.      * Generates a replacement for the matched text. Token options are:
  40.      *
  41.      * 'text' => The preformatted text.
  42.      *
  43.      * @access public
  44.      *
  45.      * @param array &$matches The array of matches from parse().
  46.      *
  47.      * @return string A token to be used as a placeholder
  48.      *  in the source text for the preformatted text.
  49.      *
  50.      */
  51.  
  52.     function process(&$matches)
  53.     {
  54.         $token $this->wiki->addToken(
  55.             $this->rule,
  56.             array('text' => htmlentities($matches[1]))
  57.         );
  58.         return "\n\n" $token "\n\n";
  59.     }
  60. }
  61. ?>

Documentation generated on Mon, 11 Mar 2019 14:55:48 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.