mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-30 17:24:16 +02:00
parent
38a6df91b9
commit
3cafc8910a
@ -131,9 +131,7 @@ class DocParser
|
|||||||
foreach ($file as $line) {
|
foreach ($file as $line) {
|
||||||
$header = $this->extractHeader($line, $lastLine);
|
$header = $this->extractHeader($line, $lastLine);
|
||||||
if ($header !== null) {
|
if ($header !== null) {
|
||||||
list($header, $id, $level) = $header; // When overwriting the variable to extract, it has to be
|
list($title, $id, $level) = $header;
|
||||||
// list()'s first parameter since list() assigns the values
|
|
||||||
// starting with the right-most parameter
|
|
||||||
while (! $stack->isEmpty() && $stack->top()->getLevel() >= $level) {
|
while (! $stack->isEmpty() && $stack->top()->getLevel() >= $level) {
|
||||||
$stack->pop();
|
$stack->pop();
|
||||||
}
|
}
|
||||||
@ -143,19 +141,19 @@ class DocParser
|
|||||||
/* @var $section Section */
|
/* @var $section Section */
|
||||||
$path[] = $section->getTitle();
|
$path[] = $section->getTitle();
|
||||||
}
|
}
|
||||||
$path[] = $header;
|
$path[] = $title;
|
||||||
$id = implode('-', $path);
|
$id = implode('-', $path);
|
||||||
$nofollow = true;
|
$nofollow = true;
|
||||||
} else {
|
} else {
|
||||||
$nofollow = false;
|
$nofollow = false;
|
||||||
}
|
}
|
||||||
if ($stack->isEmpty()) {
|
if ($stack->isEmpty()) {
|
||||||
$chapterTitle = $header;
|
$chapterTitle = $title;
|
||||||
$section = new Section($id, $header, $level, $nofollow, $chapterTitle);
|
$section = new Section($id, $title, $level, $nofollow, $chapterTitle);
|
||||||
$tree->addRoot($section);
|
$tree->addRoot($section);
|
||||||
} else {
|
} else {
|
||||||
$chapterTitle = $stack->bottom()->getTitle();
|
$chapterTitle = $stack->bottom()->getTitle();
|
||||||
$section = new Section($id, $header, $level, $nofollow, $chapterTitle);
|
$section = new Section($id, $title, $level, $nofollow, $chapterTitle);
|
||||||
$tree->addChild($section, $stack->top());
|
$tree->addChild($section, $stack->top());
|
||||||
}
|
}
|
||||||
$stack->push($section);
|
$stack->push($section);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user