Skip to content

Commit

Permalink
Anchor links now work correctly again!
Browse files Browse the repository at this point in the history
FIX: anchor links were not correctly formed, hence didn't work.
FIX: removed extra 'jump to top' link.
  • Loading branch information
MrBertie committed May 4, 2014
1 parent 80e053d commit 561cd5f
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions syntax/index.php
Expand Up @@ -155,7 +155,7 @@ private function _create_index(SI_Index $section_entries, $all_pages, $hideAtoZ,

do {

$entry = $next_entry;
$entry = $anchor = $next_entry;
$pid = $next_pid;

// cache the next entry for comparison purposes later
Expand Down Expand Up @@ -212,7 +212,7 @@ private function _create_index(SI_Index $section_entries, $all_pages, $hideAtoZ,
$cur_node = ucwords($cur_node);
}
if ($is_link) {
$anchor = SI_Utils::valid_id($entry);
$anchor = SI_Utils::valid_id($anchor);
$lines[] = array($heading, $cur_node, $links, $anchor);
$links = array();
} else {
Expand Down Expand Up @@ -266,7 +266,7 @@ private function _render_index($lines, $opt, $count){
$show_count = '<div class="count">' . $count . ' ∞</div>' . DOKU_LF;
}
if ($opt['hidejump'] === false) {
$show_jump = '<a class="top" href="#' . $top_id . '">' . $this->getLang('link_to_top') . '</a>' . DOKU_LF;
$show_jump = '<a class="jump" href="#' . $top_id . '">' . $this->getLang('link_to_top') . '</a>' . DOKU_LF;
}

$subjectindex = '';
Expand Down Expand Up @@ -313,14 +313,12 @@ private function _render_index($lines, $opt, $count){

// actual rendering to wiki page
$render = '<div class="subjectindex ' . $outer_border . '" id="' . $top_id . '">' . DOKU_LF;
$render .= $show_count . $show_jump . $label . DOKU_LF;;
$render .= $label . DOKU_LF;;
$render .= '<div class="inner ' . $inner_border . '" style="' . $col_style . '">' . DOKU_LF;;
$render .= $subjectindex;
$render .= '<a class="jump" href="#' . $top_id . '">' . $this->getLang('link_to_top') . '</a>' . DOKU_LF;;
$render .= $show_count . $show_jump;
$render .= '</div></div>' . DOKU_LF;
return $render;


}


Expand Down

0 comments on commit 561cd5f

Please sign in to comment.