Fix minor issue with non-sequential headings.

That is, for example an <h3> following an <h1> directly. In this case,
the place of the missing <h2> should be the slug of <h1>.

(Which does break the navigation if an <h2> with the same slug follows,
but this is then simply not supported. It is arguably very uncommon.)