includes/wikiengine/Render/Plain/Specialchar.php
changeset 1027 98c052fc3337
parent 1026 f0431eb8161e
child 1028 dde4416dea00
equal deleted inserted replaced
1026:f0431eb8161e 1027:98c052fc3337
     1 <?php
       
     2 // vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4:
       
     3 /**
       
     4  * Specialchar rule end renderer for Plain
       
     5  *
       
     6  * PHP versions 4 and 5
       
     7  *
       
     8  * @category   Text
       
     9  * @package    Text_Wiki
       
    10  * @author     Bertrand Gugger <bertrand@toggg.com>
       
    11  * @copyright  2005 bertrand Gugger
       
    12  * @license    http://www.gnu.org/copyleft/lesser.html  LGPL License 2.1
       
    13  * @version    CVS: $Id: Specialchar.php,v 1.1 2005/08/15 11:10:38 toggg Exp $
       
    14  * @link       http://pear.php.net/package/Text_Wiki
       
    15  */
       
    16 
       
    17 /**
       
    18  * This class renders special characters in Plain.
       
    19  *
       
    20  * @category   Text
       
    21  * @package    Text_Wiki
       
    22  * @author     Bertrand Gugger <bertrand@toggg.com>
       
    23  * @copyright  2005 bertrand Gugger
       
    24  * @license    http://www.gnu.org/copyleft/lesser.html  LGPL License 2.1
       
    25  * @version    Release: @package_version@
       
    26  * @link       http://pear.php.net/package/Text_Wiki
       
    27  */
       
    28 class Text_Wiki_Render_Plain_SpecialChar extends Text_Wiki_Render {
       
    29 
       
    30     var $types = array('~bs~' => '\\',
       
    31                        '~hs~' => ' ',
       
    32                        '~amp~' => '&',
       
    33                        '~ldq~' => '"',
       
    34                        '~rdq~' => '"',
       
    35                        '~lsq~' => "'",
       
    36                        '~rsq~' => "'",
       
    37                        '~c~' => '©',
       
    38                        '~--~' => '-',
       
    39                        '" -- "' => '-',
       
    40                        '&quot; -- &quot;' => '-',
       
    41                        '~lt~' => '<',
       
    42                        '~gt~' => '>');
       
    43 
       
    44     function token($options)
       
    45     {
       
    46         if (isset($this->types[$options['char']])) {
       
    47             return $this->types[$options['char']];
       
    48         } else {
       
    49             return $options['char'];
       
    50         }
       
    51     }
       
    52 }
       
    53 
       
    54 ?>