Replaces the current document checks that writeln adds a new line.