[ Index ]
 

Code source de Horde 3.1.3

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/Horde/Text/Filter/ -> simplemarkup.php (source)

   1  <?php
   2  /**
   3   * Highlights simple markup as used in emails or usenet postings.
   4   *
   5   * $Horde: framework/Text_Filter/Filter/simplemarkup.php,v 1.1.10.5 2006/07/24 15:54:54 slusarz Exp $
   6   *
   7   * Copyright 2004-2006 Jan Schneider <jan@horde.org>
   8   *
   9   * See the enclosed file COPYING for license information (LGPL). If you did
  10   * not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
  11   *
  12   * @author  Jan Schneider <jan@horde.org>
  13   * @since   Horde 3.0
  14   * @package Horde_Text
  15   */
  16  class Text_Filter_simplemarkup extends Text_Filter {
  17  
  18      /**
  19       * Returns a hash with replace patterns.
  20       *
  21       * @return array  Patterns hash.
  22       */
  23      function getPatterns()
  24      {
  25          $regexp = array(
  26              // Bold.
  27              '/(^|\s|&nbsp;|<br \/>)(\*[^*\s]+\*)(\s|&nbsp;|<br|\.)/i' => '\1<strong>\2</strong>\3',
  28  
  29              // Underline.
  30              '/(^|\s|&nbsp;|<br \/>)(_[^_\s]+_)(\s|&nbsp;|<br|\.)/i' => '\1<u>\2</u>\3',
  31  
  32              // Italic.
  33              ';(^|\s|&nbsp\;|<br />)(/[^/\s]+/)(\s|&nbsp\;|<br|\.);i' => '\1<em>\2</em>\3');
  34  
  35          return array('regexp' => $regexp);
  36      }
  37  
  38  }


Généré le : Sun Feb 25 18:01:28 2007 par Balluche grâce à PHPXref 0.7