strip any trailing whitespace to eliminate blank pages