Make the generated internal anchors less brittle by basing them on the h...

...eading name rather than the headings' current position.