Tweet · 19 Feb 2014, 10:41 UTC

Replying to @rodneyrehm

I know it can be optimised but that’s not the point. It should just be s.replace(/(?<!\r)\n/g, "\r\n") like in all decent langs.