Remove duplicated TOC loop in Module\Help
This commit is contained in:
parent
1f790eaeef
commit
087c3cdcd8
1 changed files with 22 additions and 24 deletions
|
@ -66,7 +66,6 @@ class Help extends BaseModule
|
||||||
$idNum = [0, 0, 0, 0, 0, 0, 0];
|
$idNum = [0, 0, 0, 0, 0, 0, 0];
|
||||||
foreach ($lines as &$line) {
|
foreach ($lines as &$line) {
|
||||||
$matches = [];
|
$matches = [];
|
||||||
foreach ($lines as &$line) {
|
|
||||||
if (preg_match('#<h([1-6])>([^<]+?)</h\1>#i', $line, $matches)) {
|
if (preg_match('#<h([1-6])>([^<]+?)</h\1>#i', $line, $matches)) {
|
||||||
$level = $matches[1];
|
$level = $matches[1];
|
||||||
$anchor = urlencode($matches[2]);
|
$anchor = urlencode($matches[2]);
|
||||||
|
@ -95,7 +94,6 @@ class Help extends BaseModule
|
||||||
$lastLevel = $level;
|
$lastLevel = $level;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
for ($k = 0; $k < $lastLevel; $k++) {
|
for ($k = 0; $k < $lastLevel; $k++) {
|
||||||
$toc .= "</ul>";
|
$toc .= "</ul>";
|
||||||
|
|
Loading…
Reference in a new issue