Add newline support to write_line