I added a click event handler onto the links in the containers panel so that the heading numbering is recalculated when the user tries to change a container to a heading.