For readability, consider using the same newline insertions that you used in the `as_text` function above.