cvs: pear /Text_Wiki/Text/Wiki/Parse/Doku Wikilink.php

From: Date: Mon, 27 Feb 2006 17:25:59 +0000
Subject: cvs: pear /Text_Wiki/Text/Wiki/Parse/Doku Wikilink.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-38696@lists.php.net to get a copy of this message
justinpatrin Mon Feb 27 17:25:59 2006 UTC Modified files: /pear/Text_Wiki/Text/Wiki/Parse/Doku Wikilink.php Log: Fix setting of anchor, fix output of links (new link code has not been merged to mainline yet....) http://cvs.php.net/viewcvs.cgi/pear/Text_Wiki/Text/Wiki/Parse/Doku/Wikilink.php?r1=1.2&r2=1.3&diff_format=u Index: pear/Text_Wiki/Text/Wiki/Parse/Doku/Wikilink.php diff -u pear/Text_Wiki/Text/Wiki/Parse/Doku/Wikilink.php:1.2 pear/Text_Wiki/Text/Wiki/Parse/Doku/Wikilink.php:1.3 --- pear/Text_Wiki/Text/Wiki/Parse/Doku/Wikilink.php:1.2 Mon Feb 27 17:02:32 2006 +++ pear/Text_Wiki/Text/Wiki/Parse/Doku/Wikilink.php Mon Feb 27 17:25:59 2006 @@ -12,7 +12,7 @@ * * @license LGPL * - * @version $Id: Wikilink.php,v 1.2 2006/02/27 17:02:32 justinpatrin Exp $ + * @version $Id: Wikilink.php,v 1.3 2006/02/27 17:25:59 justinpatrin Exp $ * */ @@ -68,9 +68,11 @@ } // described wiki links - $tmp_regex = '/\[\[(['.$either.'\s:\.]*?)'. //beginning and page name + $tmp_regex = '/\[\['. //start + '(['.$either.'\s:\.]*?)'. //page name '(\#['.$either.'\s:\.]+?)?'. //anchor - '(\|([^'.$this->wiki->delim.'\]]+?))?\]\]/'; //description + '(\|([^'.$this->wiki->delim.'\]]+?))?'. //description + '\]\]/'; //end $this->wiki->source = preg_replace_callback( $tmp_regex, array(&$this, 'processDescr'), @@ -98,18 +100,19 @@ $options = array( 'page' => $matches[1], 'text' => isset($matches[4]) && strlen($matches[4]) ? $matches[4] : $matches[1], - 'anchor' => isset($matches[2]) && strlen($matches[2]) ? $matches[2] : $matches[1] + 'anchor' => isset($matches[2]) && strlen($matches[2]) ? $matches[2] : '' ); - if ($options['text'] == $options['page']) { + /*if ($options['text'] == $options['page']) { $options['text'] = ''; - } + }*/ // create and return the replacement token and preceding text - return $this->wiki->addToken($this->rule, + $this->wiki->addToken($this->rule, $options); + /*return $this->wiki->addToken($this->rule, array_merge(array('type' => 'start'), $options)). $options['text']. $this->wiki->addToken($this->rule, - array_merge(array('type' => 'end'), $options)); + array_merge(array('type' => 'end'), $options));*/ } }

« previous php.pear.cvs (#38696) next »