MDL-37739 mod_wiki: Wiki ToC header href remove square double brackets.

When H1, H2 and H3 links in wiki act themselves as hyperlinks, they
were displayed in double brackets. This patch removes [[ and ]] out of
the table of content displayed header hyperlinks.
This commit is contained in:
Luca Bösch 2016-01-18 08:31:49 +01:00
parent e8d5100212
commit 2c13bbba2b

View File

@ -237,7 +237,9 @@ abstract class wiki_markup_parser extends generic_parser {
$number .= ".$currentsection[2]";
}
}
$toc .= parser_utils::h('p', $number . ". " . parser_utils::h('a', $header[1], array('href' => "#toc-$i")), array('class' => 'wiki-toc-section-' . $header[0] . " wiki-toc-section"));
$toc .= parser_utils::h('p', $number . ". " .
parser_utils::h('a', str_replace(array('[[', ']]'), '', $header[1]), array('href' => "#toc-$i")),
array('class' => 'wiki-toc-section-' . $header[0] . " wiki-toc-section"));
$i++;
}