This is based on #106, so that should either be merged first, or disregarded in favor of this pull request. Currently they're separate to keep the scope clean(ish). And they'd conflict if separate.
There's possibly some bugs in the implementation, but the below input works as expected:
1. root1
1. sub1
2. sub2
3. extra one
1. ssub1
2. ssub2
2. root2
1. sub 3
2. sub 4
3. root3
This is based on #106, so that should either be merged first, or disregarded in favor of this pull request. Currently they're separate to keep the scope clean(ish). And they'd conflict if separate.
There's possibly some bugs in the implementation, but the below input works as expected: