remove anchor name
trim trailing spaces