normalizing line endings and trimming trailing whitespace in post matching