call splitlines with keepends so the newlines are not removed and the formatting is not messed up.
Merge pull request #4 from goodwillcoding/master

Call splitlines with keepends so the newlines are not removed and the formatting is not messed up