cvs: pear /Text_Wiki/Text/Wiki/BBCode Parse.php
| From: | bertrand GUGGER | Date: | Sat, 16 Jul 2005 05:30:14 +0000 |
| Subject: | cvs: pear /Text_Wiki/Text/Wiki/BBCode Parse.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-33069@lists.php.net to get a copy of this message | ||
toggg Sat Jul 16 01:30:14 2005 EDT
Modified files:
/pear/Text_Wiki/Text/Wiki/BBCode Parse.php
Log:
Class header, calculate offset if synchStartEnd() changes source + error return
http://cvs.php.net/diff.php/pear/Text_Wiki/Text/Wiki/BBCode/Parse.php?r1=1.2&r2=1.3&ty=u
Index: pear/Text_Wiki/Text/Wiki/BBCode/Parse.php
diff -u pear/Text_Wiki/Text/Wiki/BBCode/Parse.php:1.2 pear/Text_Wiki/Text/Wiki/BBCode/Parse.php:1.3
--- pear/Text_Wiki/Text/Wiki/BBCode/Parse.php:1.2 Sat Jul 16 00:56:46 2005
+++ pear/Text_Wiki/Text/Wiki/BBCode/Parse.php Sat Jul 16 01:30:12 2005
@@ -10,20 +10,27 @@
* @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: Parse.php,v 1.2 2005/07/16 04:56:46 toggg Exp $
+ * @version CVS: $Id: Parse.php,v 1.3 2005/07/16 05:30:12 toggg Exp $
* @link http://pear.php.net/package/Text_Wiki
*/
/**
* Baseline rule class for BBCode parser.
*
- * @see Text_Wiki_Parse
- *
* The parse() method enables the nesting of components
* thru a custom method to synchronize "start" and "end" tags
*
* It also checks the done property (default true)
* A process() method needing to "rerun" has to set it to false
+ *
+ * @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::Text_Wiki_Parse()
*/
class Text_Wiki_Parse_BBCode extends Text_Wiki_Parse {
@@ -102,11 +109,15 @@
if ($this->wiki->tokens[$tokno][1]['type'] != 'end')
{
continue;
}
- $this->synchStartEnd(
+ $oldlen = strlen($this->wiki->source);
+ if ($err = $this->synchStartEnd(
$this->wiki->tokens[array_pop($statok)][1],
$this->wiki->tokens[$tokno][1],
- $lev, array_pop($stapos), $newpos);
- $pos = $newpos + strlen($find);
+ $lev, array_pop($stapos), $newpos)) {
+ // error ?
+ }
+ $pos = $newpos + strlen($find) +
+ strlen($this->wiki->source) - $oldlen;
$lev--;
}
} while (!$this->done);