summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2007-08-07 19:18:44 +0200
committerAndreas Gohr <andi@splitbrain.org>2007-08-07 19:18:44 +0200
commit7d91652a4c175e84188b2d8e2fe4e677dac251e8 (patch)
tree09fd4f16b551089adc7eb91c03ea7e562edebf26
parent00ce12dafb81a8d0cb1385660ddf4e8ad571ed19 (diff)
downloadrpg-7d91652a4c175e84188b2d8e2fe4e677dac251e8.tar.gz
rpg-7d91652a4c175e84188b2d8e2fe4e677dac251e8.tar.bz2
TOC fixed
This fixes some small bugs which were introduced with recent TOC changes darcs-hash:20070807171844-7ad00-fc09dd6d09b72927e64dfa41dd8b86fc20d86ed0.gz
-rw-r--r--inc/html.php8
-rw-r--r--inc/parser/xhtml.php2
2 files changed, 8 insertions, 2 deletions
diff --git a/inc/html.php b/inc/html.php
index 3ae192c73..35cb09d3a 100644
--- a/inc/html.php
+++ b/inc/html.php
@@ -1273,7 +1273,13 @@ function html_TOC($toc){
* Callback for html_buildlist
*/
function html_list_toc($item){
- return '<span class="li"><a href="'.$item['link'].'" class="toc">'.
+ if($item['hid']){
+ $link = '#'.$item['hid'];
+ }else{
+ $link = $item['link'];
+ }
+
+ return '<span class="li"><a href="'.$link.'" class="toc">'.
hsc($item['title']).'</a></span>';
}
diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php
index aba44e8da..7279844f9 100644
--- a/inc/parser/xhtml.php
+++ b/inc/parser/xhtml.php
@@ -97,7 +97,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
//handle TOC
if($level >= $conf['toptoclevel'] && $level <= $conf['maxtoclevel']){
- $this->toc[] = html_mktocitem("#$id", $text, $level-$conf['toptoclevel']+1);
+ $this->toc[] = html_mktocitem($id, $text, $level-$conf['toptoclevel']+1);
}
}