Refactor generation of ToC
Refactor generation of ToC

This replaces the existing iterative implementation of the ToC
generation with an recursive one.

This also solves the problem of skipped headers which causes wrong
leveling of them.

Signed-off-by: Sheogorath <1c2647ce2ee8a4ec8e5c8b1b245ca38f94844bab@shivering-isles.com>

Yukaii/hackmd,hackmdio/hackmd,Yukaii/hackmd,hackmdio/hackmd,jackycute/HackMD,hackmdio/hackmd,jackycute/HackMD,Yukaii/hackmd,jackycute/HackMD