trim and replace spaces in chapter names to always work in commands