fixed lack of new-line support

I used '.replace()' with a regex to add a space between line-ending punctuation and a capitalised character.
This makes up for the fact that textContent removes newlines.

It was only a small addition to 1 line of code, although git seems to think I changed a bunch of empty lines, probably something my editor did?