Fix leading/trailing whitespace syntax detection