8
0

Fix automatic table of contents, fixes #421

Dieser Commit ist enthalten in:
Stéphane Goetz 2016-11-18 10:03:21 +01:00
Ursprung e5c7747884
Commit be6438aca5

Datei anzeigen

@ -113,6 +113,8 @@ class Processor implements DocumentProcessorInterface
}
/**
* Make a tree of the list of headings
*
* @param Entry[] $headings
* @return RootEntry
*/
@ -125,7 +127,7 @@ class Processor implements DocumentProcessorInterface
$parent = $previous;
do {
$parent = $parent->getParent();
} while ($heading->getLevel() <= $parent->getLevel() || $parent->getLevel() != 0);
} while ($heading->getLevel() <= $parent->getLevel() && $parent->getLevel() != 0);
$parent->addChild($heading);
$previous = $heading;