From e41c4da9b8ec98a022a91b04f7c5d7bbee54b6c9 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 19 Feb 2006 17:47:26 +0100 Subject: some TOC fixes darcs-hash:20060219164726-7ad00-eb637e1db83e2f3b6c3629da18214b6587590b24.gz --- inc/parser/xhtml.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'inc/parser/xhtml.php') diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php index a54e5bcab..9950f28ce 100644 --- a/inc/parser/xhtml.php +++ b/inc/parser/xhtml.php @@ -89,7 +89,9 @@ class Doku_Renderer_xhtml extends Doku_Renderer { } // prepend the TOC - $this->doc = $this->render_TOC().$this->doc; + if($this->info['toc']){ + $this->doc = $this->render_TOC().$this->doc; + } } /** @@ -98,7 +100,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer { * @author Andreas Gohr */ function render_TOC(){ - if(!count($this->toc)) return ''; + if(count($this->toc) < 3) return ''; global $lang; $out = '
'.DOKU_LF; $out .= '
'; @@ -175,7 +177,6 @@ class Doku_Renderer_xhtml extends Doku_Renderer { $hid = $this->_headerToLink($text,'true'); //handle TOC -//FIXME if($this->meta['toc'] && if($level >= $conf['toptoclevel'] && $level <= $conf['maxtoclevel']){ // the TOC is one of our standard ul list arrays ;-) $this->toc[] = array( 'hid' => $hid, -- cgit v1.2.3