test for newline before using gsub
Merge pull request #118 from billsaysthis/fix-newline-handling-feb13

test for newline before using gsub