Here is what I want to do.
- Replace more than 3 line breaks with 3 line breaks.
- Replace 2 line breaks with 1 line break.
- Ignore single line breaks.
So that something like this:
Dear Bob
I would love to not have so many line breaks here.
This is a new paragraph.
Thanks
Jim
Ends up more like this:
Dear Bob
I would love to not have so many line breaks here.
This is a new paragraph.
Thanks
Jim
Based on another question, this is the closest I've come, but it's not quite right:
innerHTML.replace(/\n\n\s*\n\n/g, '\n');
\n\n\n+.\nonly line breaks? No\r\ns?