fix #2475: don't crash at link anchors