summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);
}
}