remove trailing white space in the code template