This will replace line breaks to HTML break tags. The different combinations are to cover the different browsers/systems and how line breaks are interpreted.
$(this).val().replace(/\r\n|\r|\n/g,"<br />")
This will bring it back to new lines – also covering how different browsers interpret innerHTML.
boxText.replace(/<br\s?\/?>/g,"\n");