Using pattern guard, in preparation for doing some more complicated stuff with it (recording header anchors, so we can change them to auto ids.)