HG-71 add handling for anchors that wrap other elements