How about HTML/CSS? If you put your text inside a <pre> tag, it will show all newlines exactly as they were. Alternatively, you can achieve the same effect by applying the CSS style white-space:pre to any element.
Don’t forget to HTMLencode it still (< to < etc.), otherwise it will all break apart at the first angle bracket.