Minor fix so that custom entities are trimed to remove excess whitespace.