Closed jean-gui closed 3 years ago
Thanks for fixing @jean-gui - I added a test in tests/View/TableOfContentTest.php
and added example HTML to test this issue. See function testNestedHeadings
I tested this directly in PHPUnit via: ./vendor/bin/phpunit tests/View/TableOfContentTest.php --filter testNestedHeadings
TableOfContents::parseHeadingsFromHtml() didn't go into HTML elements that were not in the list of levels. So for example passing a div containing headings to this function wouldn't return any TOC.
The fix is easy and simply makes sure the recursive call is applied to all elements.
Note: I am unable to run tests so I can't modify them to make sure this new behavior works properly.