Add id fields to the headings so they can be referenced as fragment identifiers.