def cleanSpecHeadings(headings):
    """Headings data was purposely verbose, assuming collisions even when there wasn't one.
       Want to keep the collision data for multi-page, so I can tell when you request a non-existent page,
       but need to collapse away the collision stuff for single-page."""
    for specHeadings in headings.values():
        for k, v in list(specHeadings.items()):
            if k[0] == '#' and len(v) == 1 and v[0][0:2] == '/#':
                specHeadings[k] = specHeadings[v[0]]
                del specHeadings[v[0]]
