diff --git a/mod/wiki/parser/markups/wikimarkup.php b/mod/wiki/parser/markups/wikimarkup.php index 4f5135d294d..3e1efc0fd42 100644 --- a/mod/wiki/parser/markups/wikimarkup.php +++ b/mod/wiki/parser/markups/wikimarkup.php @@ -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++; }