Changed regexp in toHTML to also match \r\n line endings

I ran into issues reading data that had been encoded with \r\n line endings not being displayed properly in the editor, which caused issues on subsequent saves. I've updated `/\n/` and `/\n\n/` to `/\r?\n/` and `/\r?\n\r?\n/`, respectively.