strip leading/trailing whitespace from chapter/subchapter identifiers