Source for file Revise.php
Documentation is available at Revise.php
// $Id: Revise.php,v 1.2 2004/09/25 19:05:13 pmjones Exp $
* This class implements a Text_Wiki_Parse to find source text marked for
* @author Paul M. Jones <pmjones@ciaweb.net>
* The regular expression used to parse the source text and find
* matches conforming to this rule. Used by the parse() method.
var $regex = "/\@\@({*?.*}*?)\@\@/U";
* Generates a replacement for the matched text. Token options are:
* 'type' => ['start'|'end'] The starting or ending point of the
* inserted text. The text itself is left in the source.
* @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 teletype text.
$delmark = $this->getConf('delmark'); // ---
$insmark = $this->getConf('insmark'); // +++
// '---' must be before '+++' (if they both appear)
$del = strpos($src, $delmark);
$ins = strpos($src, $insmark);
// if neither is found, return right away
if ($del === false && $ins === false ) {
// handle text to be deleted
// move forward to the end of the deletion mark
// there is no insertion text following
// there is insertion text following,
$text = substr($src, $del, $ins - $del);
$output .= $this->wiki->addToken (
$this->rule, array ('type' => 'del_start')
$output .= $this->wiki->addToken (
$this->rule, array ('type' => 'del_end')
// handle text to be inserted
// move forward to the end of the insert mark
$output .= $this->wiki->addToken (
$this->rule, array ('type' => 'ins_start')
$output .= $this->wiki->addToken (
$this->rule, array ('type' => 'ins_end')
Documentation generated on Mon, 11 Mar 2019 14:22:33 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|