cvs: pear /Text_Wiki/Text/Wiki/BBCode/Parse Colortext.php
| From: | bertrand GUGGER | Date: | Sat, 16 Jul 2005 05:01:36 +0000 |
| Subject: | cvs: pear /Text_Wiki/Text/Wiki/BBCode/Parse Colortext.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-33068@lists.php.net to get a copy of this message | ||
toggg Sat Jul 16 01:01:36 2005 EDT
Modified files:
/pear/Text_Wiki/Text/Wiki/BBCode/Parse Colortext.php
Log:
Headers, nesting depth for synchStartEnd() and return null
http://cvs.php.net/diff.php/pear/Text_Wiki/Text/Wiki/BBCode/Parse/Colortext.php?r1=1.2&r2=1.3&ty=u
Index: pear/Text_Wiki/Text/Wiki/BBCode/Parse/Colortext.php
diff -u pear/Text_Wiki/Text/Wiki/BBCode/Parse/Colortext.php:1.2
pear/Text_Wiki/Text/Wiki/BBCode/Parse/Colortext.php:1.3
--- pear/Text_Wiki/Text/Wiki/BBCode/Parse/Colortext.php:1.2 Tue Jul 12 09:42:11 2005
+++ pear/Text_Wiki/Text/Wiki/BBCode/Parse/Colortext.php Sat Jul 16 01:01:35 2005
@@ -1,58 +1,50 @@
<?php
+// vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4:
/**
-* @version Exp $
-*
-* BBCode: Parses for color text.
-*
-* This class implements a Text_Wiki_Rule to find source text coloured
-* as defined by text surrounded by [color=...] ... [/color]
-* On parsing, the text itself is left in place, but the starting and ending
-* tags are replaced with tokens.
-*
-* @category Text
-*
-* @package Text_Wiki
-*
-* @author Bertrand Gugger <bertrand@toggg.com>
-*
-*/
+ * BBCode: Parses for color text.
+ *
+ * This class implements a Text_Wiki_Rule to find source text coloured
+ * as defined by text surrounded by [color=...] ... [/color]
+ * On parsing, the text itself is left in place, but the starting and ending
+ * tags are replaced with tokens.
+ *
+ * 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.3 2005/07/16 05:01:35 toggg Exp $
+ * @link http://pear.php.net/package/Text_Wiki
+ */
class Text_Wiki_Parse_Colortext extends Text_Wiki_Parse_BBCode {
/**
- *
- * The regular expression used to parse the source text and find
- * matches conforming to this rule. Used by the parse() method.
- * We match either [color..] or [/color], will be post synchronized
- *
- * @access public
- *
- * @var string
- *
- * @see parse()
- *
- */
+ * The regular expression used to parse the source text and find
+ * matches conforming to this rule. Used by the parse() method.
+ * We match either [color..] or [/color], will be post synchronized
+ *
+ * @access public
+ * @var string
+ * @see parse()
+ *
+ */
var $regex =
"'(?:\[color=(aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|purple|red|silver|teal|white|yellow|\#[0-9a-f]{6})]|\[/color])'i";
/**
- *
- * Generates a replacement for the matched text. Token options are:
- *
- * 'type' => ['start'|'end'] The starting or ending point of
the
- * emphasized text. The text itself is left in the source.
- *
- * 'color' => the color indicator
- *
- * @access public
- *
- * @param array &$matches The array of matches from parse().
- *
- * @return string A pair of delimited tokens to be used as a
- * placeholder in the source text surrounding the text to be
- * emphasized.
- *
- */
-
+ * Generates a replacement for the matched text. Token options are:
+ * - 'type' => ['start'|'end'] The starting or ending point of
the
+ * colored text. The text itself is left in the source.
+ * - 'color' => the color indicator
+ *
+ * @access public
+ * @param array &$matches The array of matches from parse().
+ * @return string A delimited token to be used as a start/end
+ * placeholder in the source text surrounding the text to be
+ * colored.
+ */
function process(&$matches)
{
// end tag ?
@@ -78,25 +70,23 @@
}
/**
- *
- * Post parsing, start and end synchro
- *
- * That will just report 'color' => the color indicator
- * from start token to end token
- *
- * @access public
- *
- * @param &array $statok the param array of start token
- * @param &array $endtok the param array of end token
- * @param int $stapos the position behind start token in source
- * @param int $endpos the position of end token in source (after tag's data)
- *
- * @return null or error or integer resize source or boolean redo
- */
-
- function synchStartEnd(&$statok, &$endtok, $stapos, $endpos)
+ * Post parsing, start and end synchro
+ *
+ * That will just report 'color' => the color indicator
+ * from start token to end token
+ *
+ * @access public
+ * @param &array $statok the param array of start token
+ * @param &array $endtok the param array of end token
+ * @param int $level nesting depth
+ * @param int $stapos the position behind start token in source
+ * @param int $endpos the position of end token in source (after tag's data)
+ * @return null or error
+ */
+ function synchStartEnd(&$statok, &$endtok, $level, $stapos, $endpos)
{
$endtok['color'] = $statok['color'];
+ return null;
}
}
?>