Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: Text/Wiki/Parse/BBCode/Blockquote.php
- ===================================================================
- RCS file: /repository/pear/Text_Wiki/Text/Wiki/Parse/BBCode/Blockquote.php,v
- retrieving revision 1.4
- diff -u -r1.4 Blockquote.php
- --- Text/Wiki/Parse/BBCode/Blockquote.php 21 Feb 2006 22:47:53 -0000 1.4
- +++ Text/Wiki/Parse/BBCode/Blockquote.php 27 Oct 2008 16:09:32 -0000
- @@ -10,28 +10,29 @@
- *
- * PHP versions 4 and 5
- *
- - * @category Text
- - * @package Text_Wiki
- - * @author Bertrand Gugger <bertrand@toggg.com>
- - * @copyright 2005 bertrand Gugger
- - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- - * @version CVS: $Id: Blockquote.php,v 1.4 2006/02/21 22:47:53 toggg Exp $
- - * @link http://pear.php.net/package/Text_Wiki
- + * @category Text
- + * @package Text_Wiki
- + * @author Bertrand Gugger <bertrand@toggg.com>
- + * @copyright 2005 bertrand Gugger
- + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- + * @version CVS: $Id: Blockquote.php,v 1.4 2006/02/21 22:47:53 toggg Exp $
- + * @link http://pear.php.net/package/Text_Wiki
- */
- /**
- * Block-quoted text rule parser class (with nesting) for BBCode.
- *
- - * @category Text
- - * @package Text_Wiki
- - * @author Bertrand Gugger <bertrand@toggg.com>
- - * @copyright 2005 bertrand Gugger
- - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- - * @version Release: @package_version@
- - * @link http://pear.php.net/package/Text_Wiki
- - * @see Text_Wiki_Parse::Text_Wiki_Parse()
- + * @category Text
- + * @package Text_Wiki
- + * @author Bertrand Gugger <bertrand@toggg.com>
- + * @copyright 2005 bertrand Gugger
- + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- + * @version Release: @package_version@
- + * @link http://pear.php.net/package/Text_Wiki
- + * @see Text_Wiki_Parse::Text_Wiki_Parse()
- */
- -class Text_Wiki_Parse_Blockquote extends Text_Wiki_Parse {
- +class Text_Wiki_Parse_Blockquote extends Text_Wiki_Parse
- +{
- /**
- * The regular expression used to parse the source text and find
- @@ -60,6 +61,7 @@
- * - 'name' => the author indicator (optional)
- *
- * @param array &$matches The array of matches from parse().
- + *
- * @return string Delimited by start/end tokens to be used as
- * placeholder in the source text surrounding the text to be quoted.
- * @access public
- @@ -69,11 +71,9 @@
- // nested block ?
- if (array_key_exists(3, $matches)) {
- $this->_level++;
- - $expsub = preg_replace_callback(
- - $this->regex,
- - array(&$this, 'process'),
- - $matches[2]
- - );
- + $expsub = preg_replace_callback($this->regex,
- + array(&$this, 'process'),
- + $matches[2]);
- $this->_level--;
- } else {
- $expsub = $matches[2];
- @@ -84,7 +84,9 @@
- if (isset($matches[1])) {
- $options['name'] = $matches[1];
- }
- +
- $statok = $this->wiki->addToken($this->rule, $options);
- +
- $options['type'] = 'end';
- return $statok . $expsub . $this->wiki->addToken($this->rule, $options);
- }
- Index: Text/Wiki/Parse/BBCode/Bold.php
- ===================================================================
- RCS file: /repository/pear/Text_Wiki/Text/Wiki/Parse/BBCode/Bold.php,v
- retrieving revision 1.3
- diff -u -r1.3 Bold.php
- --- Text/Wiki/Parse/BBCode/Bold.php 21 Feb 2006 22:47:53 -0000 1.3
- +++ Text/Wiki/Parse/BBCode/Bold.php 27 Oct 2008 16:09:32 -0000
- @@ -10,28 +10,29 @@
- *
- * PHP versions 4 and 5
- *
- - * @category Text
- - * @package Text_Wiki
- - * @author Bertrand Gugger <bertrand@toggg.com>
- - * @copyright 2005 bertrand Gugger
- - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- - * @version CVS: $Id: Bold.php,v 1.3 2006/02/21 22:47:53 toggg Exp $
- - * @link http://pear.php.net/package/Text_Wiki
- + * @category Text
- + * @package Text_Wiki
- + * @author Bertrand Gugger <bertrand@toggg.com>
- + * @copyright 2005 bertrand Gugger
- + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- + * @version CVS: $Id: Blockquote.php,v 1.4 2006/02/21 22:47:53 toggg Exp $
- + * @link http://pear.php.net/package/Text_Wiki
- */
- /**
- * Bold text rule parser class for BBCode.
- *
- - * @category Text
- - * @package Text_Wiki
- - * @author Bertrand Gugger <bertrand@toggg.com>
- - * @copyright 2005 bertrand Gugger
- - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- - * @version Release: @package_version@
- - * @link http://pear.php.net/package/Text_Wiki
- - * @see Text_Wiki_Parse::Text_Wiki_Parse()
- + * @category Text
- + * @package Text_Wiki
- + * @author Bertrand Gugger <bertrand@toggg.com>
- + * @copyright 2005 bertrand Gugger
- + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- + * @version Release: @package_version@
- + * @link http://pear.php.net/package/Text_Wiki
- + * @see Text_Wiki_Parse::Text_Wiki_Parse()
- */
- -class Text_Wiki_Parse_Bold extends Text_Wiki_Parse {
- +class Text_Wiki_Parse_Bold extends Text_Wiki_Parse
- +{
- /**
- * The regular expression used to parse the source text and find
- @@ -50,6 +51,7 @@
- * emphasized text. The text itself is left in the source.
- *
- * @param array &$matches The array of matches from parse().
- + *
- * @return A pair of delimited tokens to be used as a placeholder in
- * the source text surrounding the text to be emphasized.
- * @access public
- @@ -57,7 +59,7 @@
- function process(&$matches)
- {
- $start = $this->wiki->addToken($this->rule, array('type' => 'start'));
- - $end = $this->wiki->addToken($this->rule, array('type' => 'end'));
- + $end = $this->wiki->addToken($this->rule, array('type' => 'end'));
- return $start . $matches[1] . $end;
- }
- }
- Index: Text/Wiki/Parse/BBCode/Code.php
- ===================================================================
- RCS file: /repository/pear/Text_Wiki/Text/Wiki/Parse/BBCode/Code.php,v
- retrieving revision 1.3
- diff -u -r1.3 Code.php
- --- Text/Wiki/Parse/BBCode/Code.php 21 Feb 2006 22:47:53 -0000 1.3
- +++ Text/Wiki/Parse/BBCode/Code.php 27 Oct 2008 16:09:32 -0000
- @@ -10,28 +10,29 @@
- *
- * PHP versions 4 and 5
- *
- - * @category Text
- - * @package Text_Wiki
- - * @author Bertrand Gugger <bertrand@toggg.com>
- - * @copyright 2005 bertrand Gugger
- - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- - * @version CVS: $Id: Code.php,v 1.3 2006/02/21 22:47:53 toggg Exp $
- - * @link http://pear.php.net/package/Text_Wiki
- + * @category Text
- + * @package Text_Wiki
- + * @author Bertrand Gugger <bertrand@toggg.com>
- + * @copyright 2005 bertrand Gugger
- + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- + * @version CVS: $Id: Blockquote.php,v 1.4 2006/02/21 22:47:53 toggg Exp $
- + * @link http://pear.php.net/package/Text_Wiki
- */
- /**
- * Code block rule parser class for BBCode.
- *
- - * @category Text
- - * @package Text_Wiki
- - * @author Bertrand Gugger <bertrand@toggg.com>
- - * @copyright 2005 bertrand Gugger
- - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- - * @version Release: @package_version@
- - * @link http://pear.php.net/package/Text_Wiki
- - * @see Text_Wiki_Parse::Text_Wiki_Parse()
- + * @category Text
- + * @package Text_Wiki
- + * @author Bertrand Gugger <bertrand@toggg.com>
- + * @copyright 2005 bertrand Gugger
- + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- + * @version Release: @package_version@
- + * @link http://pear.php.net/package/Text_Wiki
- + * @see Text_Wiki_Parse::Text_Wiki_Parse()
- */
- -class Text_Wiki_Parse_Code extends Text_Wiki_Parse {
- +class Text_Wiki_Parse_Code extends Text_Wiki_Parse
- +{
- /**
- * The regular expression used to parse the source text and find
- @@ -50,6 +51,7 @@
- * - 'attr' => type empty
- *
- * @param array &$matches The array of matches from parse().
- + *
- * @return A delimited token to be used as a placeholder in
- * the source text and containing the original block of text
- * @access public
- @@ -58,6 +60,6 @@
- {
- return $this->wiki->addToken($this->rule, array(
- 'text' => $matches[1],
- - 'attr' => array('type' => '') ) );
- + 'attr' => array('type' => '')));
- }
- }
- Index: Text/Wiki/Parse/BBCode/Colortext.php
- ===================================================================
- RCS file: /repository/pear/Text_Wiki/Text/Wiki/Parse/BBCode/Colortext.php,v
- retrieving revision 1.5
- diff -u -r1.5 Colortext.php
- --- Text/Wiki/Parse/BBCode/Colortext.php 21 Feb 2006 22:47:53 -0000 1.5
- +++ Text/Wiki/Parse/BBCode/Colortext.php 27 Oct 2008 16:09:33 -0000
- @@ -10,28 +10,29 @@
- *
- * PHP versions 4 and 5
- *
- - * @category Text
- - * @package Text_Wiki
- - * @author Bertrand Gugger <bertrand@toggg.com>
- - * @copyright 2005 bertrand Gugger
- - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- - * @version CVS: $Id: Colortext.php,v 1.5 2006/02/21 22:47:53 toggg Exp $
- - * @link http://pear.php.net/package/Text_Wiki
- + * @category Text
- + * @package Text_Wiki
- + * @author Bertrand Gugger <bertrand@toggg.com>
- + * @copyright 2005 bertrand Gugger
- + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- + * @version CVS: $Id: Blockquote.php,v 1.4 2006/02/21 22:47:53 toggg Exp $
- + * @link http://pear.php.net/package/Text_Wiki
- */
- /**
- * Colored text rule parser class (with nesting) for BBCode.
- *
- - * @category Text
- - * @package Text_Wiki
- - * @author Bertrand Gugger <bertrand@toggg.com>
- - * @copyright 2005 bertrand Gugger
- - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- - * @version Release: @package_version@
- - * @link http://pear.php.net/package/Text_Wiki
- - * @see Text_Wiki_Parse::Text_Wiki_Parse()
- + * @category Text
- + * @package Text_Wiki
- + * @author Bertrand Gugger <bertrand@toggg.com>
- + * @copyright 2005 bertrand Gugger
- + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- + * @version Release: @package_version@
- + * @link http://pear.php.net/package/Text_Wiki
- + * @see Text_Wiki_Parse::Text_Wiki_Parse()
- */
- -class Text_Wiki_Parse_Colortext extends Text_Wiki_Parse {
- +class Text_Wiki_Parse_Colortext extends Text_Wiki_Parse
- +{
- /**
- * The regular expression used to parse the source text and find
- @@ -61,6 +62,7 @@
- * - 'color' => the color indicator
- *
- * @param array &$matches The array of matches from parse().
- + *
- * @return string Delimited by start/end tokens to be used as
- * placeholder in the source text surrounding the text to be colored.
- * @access public
- @@ -70,11 +72,9 @@
- // nested block ?
- if (array_key_exists(2, $matches)) {
- $this->_level++;
- - $expsub = preg_replace_callback(
- - $this->regex,
- - array(&$this, 'process'),
- - $matches[2]
- - );
- + $expsub = preg_replace_callback($this->regex,
- + array(&$this, 'process'),
- + $matches[2]);
- $this->_level--;
- } else {
- $expsub = $matches[2];
- @@ -85,7 +85,9 @@
- // builds the option array
- $options = array('type' => 'start', 'level' => $this->_level, 'color' => $color);
- +
- $statok = $this->wiki->addToken($this->rule, $options);
- +
- $options['type'] = 'end';
- return $statok . $expsub . $this->wiki->addToken($this->rule, $options);
- }
- Index: Text/Wiki/Parse/BBCode/Font.php
- ===================================================================
- RCS file: /repository/pear/Text_Wiki/Text/Wiki/Parse/BBCode/Font.php,v
- retrieving revision 1.4
- diff -u -r1.4 Font.php
- --- Text/Wiki/Parse/BBCode/Font.php 21 Feb 2006 22:47:53 -0000 1.4
- +++ Text/Wiki/Parse/BBCode/Font.php 27 Oct 2008 16:09:33 -0000
- @@ -10,28 +10,29 @@
- *
- * PHP versions 4 and 5
- *
- - * @category Text
- - * @package Text_Wiki
- - * @author Bertrand Gugger <bertrand@toggg.com>
- - * @copyright 2005 bertrand Gugger
- - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- - * @version CVS: $Id: Font.php,v 1.4 2006/02/21 22:47:53 toggg Exp $
- - * @link http://pear.php.net/package/Text_Wiki
- + * @category Text
- + * @package Text_Wiki
- + * @author Bertrand Gugger <bertrand@toggg.com>
- + * @copyright 2005 bertrand Gugger
- + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- + * @version CVS: $Id: Blockquote.php,v 1.4 2006/02/21 22:47:53 toggg Exp $
- + * @link http://pear.php.net/package/Text_Wiki
- */
- /**
- * Font rule parser class (with nesting) for BBCode. ([size=...]...[/size])
- *
- - * @category Text
- - * @package Text_Wiki
- - * @author Bertrand Gugger <bertrand@toggg.com>
- - * @copyright 2005 bertrand Gugger
- - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- - * @version Release: @package_version@
- - * @link http://pear.php.net/package/Text_Wiki
- - * @see Text_Wiki_Parse::Text_Wiki_Parse()
- + * @category Text
- + * @package Text_Wiki
- + * @author Bertrand Gugger <bertrand@toggg.com>
- + * @copyright 2005 bertrand Gugger
- + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- + * @version Release: @package_version@
- + * @link http://pear.php.net/package/Text_Wiki
- + * @see Text_Wiki_Parse::Text_Wiki_Parse()
- */
- -class Text_Wiki_Parse_Font extends Text_Wiki_Parse {
- +class Text_Wiki_Parse_Font extends Text_Wiki_Parse
- +{
- /**
- * The regular expression used to parse the source text and find
- @@ -59,6 +60,7 @@
- * - 'size' => the size indicator
- *
- * @param array &$matches The array of matches from parse().
- + *
- * @return string Delimited by start/end tokens to be used as
- * placeholder in the source text surrounding the text to be sized.
- * @access public
- @@ -68,11 +70,9 @@
- // nested block ?
- if (array_key_exists(3, $matches)) {
- $this->_level++;
- - $expsub = preg_replace_callback(
- - $this->regex,
- - array(&$this, 'process'),
- - $matches[2]
- - );
- + $expsub = preg_replace_callback($this->regex,
- + array(&$this, 'process'),
- + $matches[2]);
- $this->_level--;
- } else {
- $expsub = $matches[2];
- @@ -80,7 +80,9 @@
- // builds the option array
- $options = array('type' => 'start', 'level' => $this->_level, 'size' => $matches[1]);
- +
- $statok = $this->wiki->addToken($this->rule, $options);
- +
- $options['type'] = 'end';
- return $statok . $expsub . $this->wiki->addToken($this->rule, $options);
- }
- Index: Text/Wiki/Parse/BBCode/Image.php
- ===================================================================
- RCS file: /repository/pear/Text_Wiki/Text/Wiki/Parse/BBCode/Image.php,v
- retrieving revision 1.6
- diff -u -r1.6 Image.php
- --- Text/Wiki/Parse/BBCode/Image.php 21 Feb 2006 22:47:53 -0000 1.6
- +++ Text/Wiki/Parse/BBCode/Image.php 27 Oct 2008 16:09:33 -0000
- @@ -9,28 +9,29 @@
- *
- * PHP versions 4 and 5
- *
- - * @category Text
- - * @package Text_Wiki
- - * @author Bertrand Gugger <bertrand@toggg.com>
- - * @copyright 2005 bertrand Gugger
- - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- - * @version CVS: $Id: Image.php,v 1.6 2006/02/21 22:47:53 toggg Exp $
- - * @link http://pear.php.net/package/Text_Wiki
- + * @category Text
- + * @package Text_Wiki
- + * @author Bertrand Gugger <bertrand@toggg.com>
- + * @copyright 2005 bertrand Gugger
- + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- + * @version CVS: $Id: Blockquote.php,v 1.4 2006/02/21 22:47:53 toggg Exp $
- + * @link http://pear.php.net/package/Text_Wiki
- */
- /**
- * Image rule parser class for BBCode.
- *
- - * @category Text
- - * @package Text_Wiki
- - * @author Bertrand Gugger <bertrand@toggg.com>
- - * @copyright 2005 bertrand Gugger
- - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- - * @version Release: @package_version@
- - * @link http://pear.php.net/package/Text_Wiki
- - * @see Text_Wiki_Parse::Text_Wiki_Parse()
- + * @category Text
- + * @package Text_Wiki
- + * @author Bertrand Gugger <bertrand@toggg.com>
- + * @copyright 2005 bertrand Gugger
- + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- + * @version Release: @package_version@
- + * @link http://pear.php.net/package/Text_Wiki
- + * @see Text_Wiki_Parse::Text_Wiki_Parse()
- */
- -class Text_Wiki_Parse_Image extends Text_Wiki_Parse {
- +class Text_Wiki_Parse_Image extends Text_Wiki_Parse
- +{
- /**
- * Configuration keys for this rule
- @@ -52,11 +53,12 @@
- 'local_regexp' => '(?:/?[^/\s"<\\\#delim#\ca-\cz]+)*'
- );
- - /**
- + /**
- * Constructor.
- * We override the constructor to build up the regex from config
- *
- * @param object &$obj the base conversion handler
- + *
- * @return The parser object
- * @access public
- */
- @@ -67,12 +69,22 @@
- // convert the list of recognized schemes to a regex OR,
- $schemes = $this->getConf('schemes', $default['schemes']);
- - $this->regex = '#\[img]((?:(?:' . (is_array($schemes) ? implode('|', $schemes) : $schemes) . ')://' .
- +
- + $schemes_regex = is_array($schemes) ? implode('|', $schemes) : $schemes;
- +
- + $this->regex = '#\[img]((?:(?:' . $schemes_regex . ')://' .
- $this->getConf('url_regexp', $default['url_regexp']);
- +
- if ($local = $this->getConf('local_regexp', $default['local_regexp'])) {
- - $this->regex .= '|' . ( is_array($local) ? implode('|', $local) : $local );
- + $this->regex .= '|';
- + if (is_array($local)) {
- + $this->regex .= implode('|', $local);
- + } else {
- + $this->regex .= $local;
- + }
- }
- $this->regex .= ')';
- +
- // add the extensions if any
- if ($extensions = $this->getConf('extensions', array())) {
- if (is_array($extensions)) {
- @@ -80,8 +92,9 @@
- }
- $this->regex .= '\.(?:' . $extensions . ')';
- }
- +
- // replace delim in the regexps
- - $this->regex = str_replace( '#delim#', $this->wiki->delim, $this->regex);
- + $this->regex = str_replace('#delim#', $this->wiki->delim, $this->regex);
- $this->regex .= ')\[/img]#i';
- }
- @@ -91,6 +104,7 @@
- * 'attr' => empty for basic BBCode
- *
- * @param array &$matches The array of matches from parse().
- + *
- * @return string Delimited token representing the image
- * @access public
- */
- Index: Text/Wiki/Parse/BBCode/Italic.php
- ===================================================================
- RCS file: /repository/pear/Text_Wiki/Text/Wiki/Parse/BBCode/Italic.php,v
- retrieving revision 1.3
- diff -u -r1.3 Italic.php
- --- Text/Wiki/Parse/BBCode/Italic.php 21 Feb 2006 22:47:53 -0000 1.3
- +++ Text/Wiki/Parse/BBCode/Italic.php 27 Oct 2008 16:09:33 -0000
- @@ -10,28 +10,29 @@
- *
- * PHP versions 4 and 5
- *
- - * @category Text
- - * @package Text_Wiki
- - * @author Bertrand Gugger <bertrand@toggg.com>
- - * @copyright 2005 bertrand Gugger
- - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- - * @version CVS: $Id: Italic.php,v 1.3 2006/02/21 22:47:53 toggg Exp $
- - * @link http://pear.php.net/package/Text_Wiki
- + * @category Text
- + * @package Text_Wiki
- + * @author Bertrand Gugger <bertrand@toggg.com>
- + * @copyright 2005 bertrand Gugger
- + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- + * @version CVS: $Id: Blockquote.php,v 1.4 2006/02/21 22:47:53 toggg Exp $
- + * @link http://pear.php.net/package/Text_Wiki
- */
- /**
- * Italic text rule parser class for BBCode.
- *
- - * @category Text
- - * @package Text_Wiki
- - * @author Bertrand Gugger <bertrand@toggg.com>
- - * @copyright 2005 bertrand Gugger
- - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- - * @version Release: @package_version@
- - * @link http://pear.php.net/package/Text_Wiki
- - * @see Text_Wiki_Parse::Text_Wiki_Parse()
- + * @category Text
- + * @package Text_Wiki
- + * @author Bertrand Gugger <bertrand@toggg.com>
- + * @copyright 2005 bertrand Gugger
- + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- + * @version Release: @package_version@
- + * @link http://pear.php.net/package/Text_Wiki
- + * @see Text_Wiki_Parse::Text_Wiki_Parse()
- */
- -class Text_Wiki_Parse_Italic extends Text_Wiki_Parse {
- +class Text_Wiki_Parse_Italic extends Text_Wiki_Parse
- +{
- /**
- * The regular expression used to parse the source text and find
- @@ -49,6 +50,7 @@
- * emphasized text. The text itself is left in the source.
- *
- * @param array &$matches The array of matches from parse().
- + *
- * @return A pair of delimited tokens to be used as a placeholder in
- * the source text surrounding the text to be emphasized.
- * @access public
- @@ -56,7 +58,7 @@
- function process(&$matches)
- {
- $start = $this->wiki->addToken($this->rule, array('type' => 'start'));
- - $end = $this->wiki->addToken($this->rule, array('type' => 'end'));
- + $end = $this->wiki->addToken($this->rule, array('type' => 'end'));
- return $start . $matches[1] . $end;
- }
- }
- Index: Text/Wiki/Parse/BBCode/List.php
- ===================================================================
- RCS file: /repository/pear/Text_Wiki/Text/Wiki/Parse/BBCode/List.php,v
- retrieving revision 1.6
- diff -u -r1.6 List.php
- --- Text/Wiki/Parse/BBCode/List.php 22 Dec 2006 14:43:06 -0000 1.6
- +++ Text/Wiki/Parse/BBCode/List.php 27 Oct 2008 16:09:33 -0000
- @@ -11,28 +11,29 @@
- *
- * PHP versions 4 and 5
- *
- - * @category Text
- - * @package Text_Wiki
- - * @author Bertrand Gugger <bertrand@toggg.com>
- - * @copyright 2005 bertrand Gugger
- - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- - * @version CVS: $Id: List.php,v 1.6 2006/12/22 14:43:06 toggg Exp $
- - * @link http://pear.php.net/package/Text_Wiki
- + * @category Text
- + * @package Text_Wiki
- + * @author Bertrand Gugger <bertrand@toggg.com>
- + * @copyright 2005 bertrand Gugger
- + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- + * @version CVS: $Id: Blockquote.php,v 1.4 2006/02/21 22:47:53 toggg Exp $
- + * @link http://pear.php.net/package/Text_Wiki
- */
- /**
- * List rule parser class for BBCode.
- *
- - * @category Text
- - * @package Text_Wiki
- - * @author Bertrand Gugger <bertrand@toggg.com>
- - * @copyright 2005 bertrand Gugger
- - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- - * @version Release: @package_version@
- - * @link http://pear.php.net/package/Text_Wiki
- - * @see Text_Wiki_Parse::Text_Wiki_Parse()
- + * @category Text
- + * @package Text_Wiki
- + * @author Bertrand Gugger <bertrand@toggg.com>
- + * @copyright 2005 bertrand Gugger
- + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- + * @version Release: @package_version@
- + * @link http://pear.php.net/package/Text_Wiki
- + * @see Text_Wiki_Parse::Text_Wiki_Parse()
- */
- -class Text_Wiki_Parse_List extends Text_Wiki_Parse {
- +class Text_Wiki_Parse_List extends Text_Wiki_Parse
- +{
- /**
- * The regular expression used to parse the source text and find
- @@ -102,6 +103,7 @@
- * 'key' => the optional starting number/letter (not for items)
- *
- * @param array &$matches The array of matches from parse().
- + *
- * @return A delimited token to be used as a placeholder in
- * the source text and containing the original block of text
- * @access public
- @@ -110,11 +112,9 @@
- {
- if (!empty($matches[3])) {
- $this->_level++;
- - $expsub = preg_replace_callback(
- - $this->regex,
- - array(&$this, 'process'),
- - $matches[2]
- - );
- + $expsub = preg_replace_callback($this->regex,
- + array(&$this, 'process'),
- + $matches[2]);
- $this->_level--;
- } else {
- $expsub = $matches[2];
- @@ -123,26 +123,28 @@
- $this->_type[$this->_level] = 'number';
- if (is_numeric($matches[1])) {
- $format = '1';
- +
- $key = $matches[1] + 0;
- } elseif (($matches[1] == 'i') || ($matches[1] == 'I')) {
- $format = $matches[1];
- } else {
- - $format =
- - ($matches[1] >= 'a') && ($matches[1] <='z') ? 'a' : 'A';
- + $format = ($matches[1] >= 'a') && ($matches[1] <='z') ? 'a' : 'A';
- +
- $key = $matches[1];
- }
- } else {
- $this->_type[$this->_level] = 'bullet';
- }
- +
- $this->_count[$this->_level] = -1;
- - $sub = preg_replace_callback(
- - $this->regexElement,
- - array(&$this, 'processElement'),
- - $expsub
- - );
- - $param = array(
- - 'level' => $this->_level,
- - 'count' => $this->_count[$this->_level] );
- +
- + $sub = preg_replace_callback($this->regexElement,
- + array(&$this, 'processElement'),
- + $expsub);
- +
- + $param = array('level' => $this->_level,
- + 'count' => $this->_count[$this->_level]);
- +
- $param['type'] = $this->_type[$this->_level].'_list_start';
- if (isset($format)) {
- $param['format'] = $format;
- @@ -150,9 +152,12 @@
- if (isset($key)) {
- $param['key'] = $key;
- }
- - $ret = $this->wiki->addToken($this->rule, $param );
- +
- + $ret = $this->wiki->addToken($this->rule, $param);
- +
- $param['type'] = $this->_type[$this->_level].'_list_end';
- - return $ret . $sub . $this->wiki->addToken($this->rule, $param );
- +
- + return $ret . $sub . $this->wiki->addToken($this->rule, $param);
- }
- /**
- @@ -168,6 +173,7 @@
- * 'count' => the item ordeer at this level.
- *
- * @param array &$matches The array of matches from parse().
- + *
- * @return A delimited token to be used as a placeholder in
- * the source text and containing the original block of text
- * @access public
- @@ -177,11 +183,11 @@
- return $this->wiki->addToken($this->rule, array(
- 'type' => $this->_type[$this->_level] . '_item_start',
- 'level' => $this->_level,
- - 'count' => ++$this->_count[$this->_level]) ) .
- + 'count' => ++$this->_count[$this->_level])) .
- rtrim($matches[1]) .
- $this->wiki->addToken($this->rule, array(
- 'type' => $this->_type[$this->_level] . '_item_end',
- 'level' => $this->_level,
- - 'count' => $this->_count[$this->_level]) );
- + 'count' => $this->_count[$this->_level]));
- }
- }
- Index: Text/Wiki/Parse/BBCode/Subscript.php
- ===================================================================
- RCS file: /repository/pear/Text_Wiki/Text/Wiki/Parse/BBCode/Subscript.php,v
- retrieving revision 1.2
- diff -u -r1.2 Subscript.php
- --- Text/Wiki/Parse/BBCode/Subscript.php 21 Feb 2006 22:47:53 -0000 1.2
- +++ Text/Wiki/Parse/BBCode/Subscript.php 27 Oct 2008 16:09:33 -0000
- @@ -1,7 +1,7 @@
- <?php
- /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker */
- -// {{{ Header
- +
- /**
- * BBCode: Parses for subscript text.
- @@ -13,28 +13,31 @@
- *
- * PHP versions 4 and 5
- *
- - * @category Text
- - * @package Text_Wiki
- - * @author Firman Wandayandi <firman@php.net>
- + * @category Text
- + * @package Text_Wiki
- + * @author Firman Wandayandi <firman@php.net>
- * @copyright 2005 bertrand Gugger
- - * @license http://www.gnu.org/copyleft/lgpl.html
- - * GNU Lesser General Public License, version 2.1
- - * @version CVS: $Id: Subscript.php,v 1.2 2006/02/21 22:47:53 toggg Exp $
- + * @license http://www.gnu.org/copyleft/lgpl.html
- + * GNU Lesser General Public License, version 2.1
- + * @version CVS: $Id: Superscript.php,v 1.2 2006/02/21 22:47:53 toggg Exp $
- + * @link http://pear.php.net/package/Text_Wiki
- +
- */
- -// }}}
- +
- // {{{ Class: Text_Wiki_Parse_Subscript
- /**
- * Subscript text rule parser class for BBCode.
- *
- - * @category Text
- - * @package Text_Wiki
- - * @author Firman Wandayandi <firman@php.net>
- + * @category Text
- + * @package Text_Wiki
- + * @author Firman Wandayandi <firman@php.net>
- * @copyright 2005 bertrand Gugger
- - * @license http://www.gnu.org/copyleft/lgpl.html
- - * GNU Lesser General Public License, version 2.1
- - * @version Release: @package_version@
- + * @license http://www.gnu.org/copyleft/lgpl.html
- + * GNU Lesser General Public License, version 2.1
- + * @version Release: @package_version@
- + * @link http://pear.php.net/package/Text_Wiki
- */
- class Text_Wiki_Parse_Subscript extends Text_Wiki_Parse
- {
- @@ -59,6 +62,7 @@
- * emphasized text. The text itself is left in the source.
- *
- * @param array &$matches The array of matches from parse().
- + *
- * @return A pair of delimited tokens to be used as a placeholder in
- * the source text surrounding the text to be emphasized.
- * @access public
- @@ -66,7 +70,7 @@
- function process(&$matches)
- {
- $start = $this->wiki->addToken($this->rule, array('type' => 'start'));
- - $end = $this->wiki->addToken($this->rule, array('type' => 'end'));
- + $end = $this->wiki->addToken($this->rule, array('type' => 'end'));
- return $start . $matches[1] . $end;
- }
- Index: Text/Wiki/Parse/BBCode/Superscript.php
- ===================================================================
- RCS file: /repository/pear/Text_Wiki/Text/Wiki/Parse/BBCode/Superscript.php,v
- retrieving revision 1.2
- diff -u -r1.2 Superscript.php
- --- Text/Wiki/Parse/BBCode/Superscript.php 21 Feb 2006 22:47:53 -0000 1.2
- +++ Text/Wiki/Parse/BBCode/Superscript.php 27 Oct 2008 16:09:33 -0000
- @@ -1,8 +1,5 @@
- <?php
- /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker */
- -
- -// {{{ Header
- -
- /**
- * BBCode: Parses for superscript text.
- *
- @@ -13,28 +10,29 @@
- *
- * PHP versions 4 and 5
- *
- - * @category Text
- - * @package Text_Wiki
- - * @author Firman Wandayandi <firman@php.net>
- + * @category Text
- + * @package Text_Wiki
- + * @author Firman Wandayandi <firman@php.net>
- * @copyright 2005 bertrand Gugger
- - * @license http://www.gnu.org/copyleft/lgpl.html
- - * GNU Lesser General Public License, version 2.1
- - * @version CVS: $Id: Superscript.php,v 1.2 2006/02/21 22:47:53 toggg Exp $
- + * @license http://www.gnu.org/copyleft/lgpl.html
- + * GNU Lesser General Public License, version 2.1
- + * @version CVS: $Id: Superscript.php,v 1.2 2006/02/21 22:47:53 toggg Exp $
- + * @link http://pear.php.net/package/Text_Wiki
- */
- -// }}}
- // {{{ Class: Text_Wiki_Parse_Superscript
- /**
- * Superscript text rule parser class for BBCode.
- *
- - * @category Text
- - * @package Text_Wiki
- - * @author Firman Wandayandi <firman@php.net>
- + * @category Text
- + * @package Text_Wiki
- + * @author Firman Wandayandi <firman@php.net>
- * @copyright 2005 bertrand Gugger
- - * @license http://www.gnu.org/copyleft/lgpl.html
- - * GNU Lesser General Public License, version 2.1
- - * @version Release: @package_version@
- + * @license http://www.gnu.org/copyleft/lgpl.html
- + * GNU Lesser General Public License, version 2.1
- + * @version Release: @package_version@
- + * @link http://pear.php.net/package/Text_Wiki
- */
- class Text_Wiki_Parse_Superscript extends Text_Wiki_Parse
- {
- @@ -58,6 +56,7 @@
- * emphasized text. The text itself is left in the source.
- *
- * @param array &$matches The array of matches from parse().
- + *
- * @return A pair of delimited tokens to be used as a placeholder in
- * the source text surrounding the text to be emphasized.
- * @access public
- @@ -65,7 +64,7 @@
- function process(&$matches)
- {
- $start = $this->wiki->addToken($this->rule, array('type' => 'start'));
- - $end = $this->wiki->addToken($this->rule, array('type' => 'end'));
- + $end = $this->wiki->addToken($this->rule, array('type' => 'end'));
- return $start . $matches[1] . $end;
- }
- Index: Text/Wiki/Parse/BBCode/Underline.php
- ===================================================================
- RCS file: /repository/pear/Text_Wiki/Text/Wiki/Parse/BBCode/Underline.php,v
- retrieving revision 1.3
- diff -u -r1.3 Underline.php
- --- Text/Wiki/Parse/BBCode/Underline.php 21 Feb 2006 22:47:53 -0000 1.3
- +++ Text/Wiki/Parse/BBCode/Underline.php 27 Oct 2008 16:09:33 -0000
- @@ -10,28 +10,29 @@
- *
- * PHP versions 4 and 5
- *
- - * @category Text
- - * @package Text_Wiki
- - * @author Bertrand Gugger <bertrand@toggg.com>
- - * @copyright 2005 bertrand Gugger
- - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- - * @version CVS: $Id: Underline.php,v 1.3 2006/02/21 22:47:53 toggg Exp $
- - * @link http://pear.php.net/package/Text_Wiki
- + * @category Text
- + * @package Text_Wiki
- + * @author Bertrand Gugger <bertrand@toggg.com>
- + * @copyright 2005 bertrand Gugger
- + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- + * @version CVS: $Id: Blockquote.php,v 1.4 2006/02/21 22:47:53 toggg Exp $
- + * @link http://pear.php.net/package/Text_Wiki
- */
- /**
- * Underlined text rule parser class for BBCode.
- *
- - * @category Text
- - * @package Text_Wiki
- - * @author Bertrand Gugger <bertrand@toggg.com>
- - * @copyright 2005 bertrand Gugger
- - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- - * @version Release: @package_version@
- - * @link http://pear.php.net/package/Text_Wiki
- - * @see Text_Wiki_Parse::Text_Wiki_Parse()
- + * @category Text
- + * @package Text_Wiki
- + * @author Bertrand Gugger <bertrand@toggg.com>
- + * @copyright 2005 bertrand Gugger
- + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- + * @version Release: @package_version@
- + * @link http://pear.php.net/package/Text_Wiki
- + * @see Text_Wiki_Parse::Text_Wiki_Parse()
- */
- -class Text_Wiki_Parse_Underline extends Text_Wiki_Parse {
- +class Text_Wiki_Parse_Underline extends Text_Wiki_Parse
- +{
- /**
- * The regular expression used to parse the source text and find
- @@ -50,6 +51,7 @@
- * emphasized text. The text itself is left in the source.
- *
- * @param array &$matches The array of matches from parse().
- + *
- * @return A pair of delimited tokens to be used as a placeholder in
- * the source text surrounding the text to be emphasized.
- * @access public
- @@ -57,6 +59,7 @@
- function process(&$matches)
- {
- $start = $this->wiki->addToken($this->rule, array('type' => 'start'));
- +
- $end = $this->wiki->addToken($this->rule, array('type' => 'end'));
- return $start . $matches[1] . $end;
- }
- Index: Text/Wiki/Parse/BBCode/Url.php
- ===================================================================
- RCS file: /repository/pear/Text_Wiki/Text/Wiki/Parse/BBCode/Url.php,v
- retrieving revision 1.9
- diff -u -r1.9 Url.php
- --- Text/Wiki/Parse/BBCode/Url.php 22 Dec 2006 09:16:24 -0000 1.9
- +++ Text/Wiki/Parse/BBCode/Url.php 27 Oct 2008 16:09:33 -0000
- @@ -10,28 +10,29 @@
- *
- * PHP versions 4 and 5
- *
- - * @category Text
- - * @package Text_Wiki
- - * @author Bertrand Gugger <bertrand@toggg.com>
- - * @copyright 2005 bertrand Gugger
- - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- - * @version CVS: $Id: Url.php,v 1.9 2006/12/22 09:16:24 toggg Exp $
- - * @link http://pear.php.net/package/Text_Wiki
- + * @category Text
- + * @package Text_Wiki
- + * @author Bertrand Gugger <bertrand@toggg.com>
- + * @copyright 2005 bertrand Gugger
- + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- + * @version CVS: $Id: Blockquote.php,v 1.4 2006/02/21 22:47:53 toggg Exp $
- + * @link http://pear.php.net/package/Text_Wiki
- */
- /**
- * Url rule parser class for BBCode.
- *
- - * @category Text
- - * @package Text_Wiki
- - * @author Bertrand Gugger <bertrand@toggg.com>
- - * @copyright 2005 bertrand Gugger
- - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- - * @version Release: @package_version@
- - * @link http://pear.php.net/package/Text_Wiki
- - * @see Text_Wiki_Parse::Text_Wiki_Parse()
- + * @category Text
- + * @package Text_Wiki
- + * @author Bertrand Gugger <bertrand@toggg.com>
- + * @copyright 2005 bertrand Gugger
- + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- + * @version Release: @package_version@
- + * @link http://pear.php.net/package/Text_Wiki
- + * @see Text_Wiki_Parse::Text_Wiki_Parse()
- */
- -class Text_Wiki_Parse_Url extends Text_Wiki_Parse {
- +class Text_Wiki_Parse_Url extends Text_Wiki_Parse
- +{
- /**
- * Configuration keys for this rule
- @@ -73,11 +74,12 @@
- '#([\n\r\s#delim#](mailto:)?)(#email#)#i',
- );
- - /**
- + /**
- * Constructor.
- * We override the constructor to build up the regex from config
- *
- * @param object &$obj the base conversion handler
- + *
- * @return The parser object
- * @access public
- */
- @@ -91,33 +93,42 @@
- if (is_string($this->refused)) {
- $this->refused = array($this->refused);
- }
- +
- // convert the list of recognized schemes to a regex OR,
- $schemes = $this->getConf('schemes', $default['schemes']);
- +
- $url = '(?:(' . (is_array($schemes) ? implode('|', $schemes) : $schemes) . ')://';
- +
- // add the "lazy" prefixes if any
- $prefixes = $this->getConf('prefixes', array());
- foreach ($prefixes as $val) {
- $url .= '|' . preg_quote($val, '#') . '\.';
- }
- +
- $host = $this->getConf('host_regexp', $default['host_regexp']);
- $path = $this->getConf('path_regexp', $default['path_regexp']);
- +
- // the full url regexp
- $url .= ')' . $host . $path;
- +
- // the full email regexp
- $email = $this->getConf('user_regexp', $default['user_regexp']) . '@' . $host;
- +
- // inline to disable ?
- if (!$this->getConf('inline_enable', true)) {
- unset($this->regex[1]);
- unset($this->regex[3]);
- }
- +
- // relative url to enable ?
- if ($this->getConf('relative_enable', false)) {
- - $this->regex[5] = str_replace( '#url#', $path, $this->regex[0]);
- + $this->regex[5] = str_replace('#url#', $path, $this->regex[0]);
- }
- +
- // replace in the regexps
- - $this->regex = str_replace( '#url#', $url, $this->regex);
- - $this->regex = str_replace( '#email#', $email, $this->regex);
- - $this->regex = str_replace( '#delim#', $this->wiki->delim, $this->regex);
- + $this->regex = str_replace('#url#', $url, $this->regex);
- + $this->regex = str_replace('#email#', $email, $this->regex);
- + $this->regex = str_replace('#delim#', $this->wiki->delim, $this->regex);
- }
- /**
- @@ -127,6 +138,7 @@
- * 'text' => the displayed text of the URL link
- *
- * @param array &$matches The array of matches from parse().
- + *
- * @return string Delimited token representing the url
- * @access public
- */
- @@ -135,8 +147,10 @@
- if ($this->refused && isset($matches[3]) && in_array($matches[3], $this->refused)) {
- return $matches[0];
- }
- - $pre = '';
- +
- + $pre = '';
- $type = 'inline';
- +
- if (isset($matches[1])) {
- if (strpos(strtolower($matches[1]), 'mail')) {
- if (isset($matches[2])) {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement