Unify the -/= and ## style headers

so that TOC can be generated properly from a mixed-markup document.

With the current code the TOC for the following document:

````
#ha
hb
---
#hc
````

is generated as: hb ha hc, while the correct order would be ha hb hc