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