This won't necessarily preserve exact formatting (for example, if there are multiple blank lines in a row), but seems standard way to do it and maybe sufficient?
Merge pull request #127 from jessib/bugfix/4786_ticket_comment_format

This won't necessarily preserve exact formatting (for example, if there ...