From: <var...@us...> - 2010-03-31 09:00:33
|
Revision: 7310 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7310&view=rev Author: vargenau Date: 2010-03-31 09:00:27 +0000 (Wed, 31 Mar 2010) Log Message: ----------- Make all 5 levels work Modified Paths: -------------- trunk/lib/plugin/CreateToc.php Modified: trunk/lib/plugin/CreateToc.php =================================================================== --- trunk/lib/plugin/CreateToc.php 2010-03-30 11:38:23 UTC (rev 7309) +++ trunk/lib/plugin/CreateToc.php 2010-03-31 09:00:27 UTC (rev 7310) @@ -2,7 +2,7 @@ rcs_id('$Id$'); /* * Copyright 2004,2005 $ThePhpWikiProgrammingTeam - * Copyright 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent + * Copyright 2008-2010 Marc-Etienne Vargenau, Alcatel-Lucent * * This file is part of PhpWiki. * @@ -275,10 +275,12 @@ if ($level < 1 or $level > 5) continue; $phpwikiclassiclevel = 4 -$level; $wikicreolelevel = $level + 1; - if ($phpwikiclassiclevel < 1 or $phpwikiclassiclevel > 3) continue; - if ((preg_match('/^\s*(!{'.$phpwikiclassiclevel.','.$phpwikiclassiclevel.'})([^!].*)$/', $content[$i], $match)) - or (preg_match('/^\s*(={'.$wikicreolelevel.','.$wikicreolelevel.'})([^=].*)$/', $content[$i], $match)) ) - { + $trim = trim($content[$i]); + + if ((((strpos($trim, '=') === 0)) + && (preg_match('/^\s*(={'.$wikicreolelevel.','.$wikicreolelevel.'})([^=].*)$/', $content[$i], $match))) + or (((strpos($trim, '!') === 0)) + && ((preg_match('/^\s*(!{'.$phpwikiclassiclevel.','.$phpwikiclassiclevel.'})([^!].*)$/', $content[$i], $match))))) { $this->_tocCounter($tocCounter, $level); if (!strstr($content[$i],'#[')) { $s = trim($match[2]); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |