Don't swallow empty lines in doctest; split lines on Mac/Windows/Unix.

Use a line-splitting regexp that works on Mac, Windows, and Unix, without
swallowing blank lines.