trim whitespace from anchors