Given the following text in a textarea:
Line 1 stuff.. Line 1 stuff.. Line 1 stuff.. Line 1 stuff.. Line 1 stuff..
Line 2 stuff.. Line 2 stuff.. Line 2 stuff.. Line 2 stuff.. Line 2 stuff..
I want to convert the new lines to <BR> tags, not use the simple_format <P> tags...
So I tried:
str = str.gsub("\r\n", '<br>')
Problem is this is making two <BR> tags:
<div class="message">line 1<br><br>Line 2</div>
How can make just one <BR> tag?
`](http://brainstormsandraves.com/articles/semantics/structure/#br) used this way isn't [semantic](http://webstyleguide.com/wsg3/5-site-structure/2-semantic-markup.html); use something more appropriate, such as a paragraph or [list](http://www.w3.org/TR/html401/struct/lists.html) element. – outis Jan 21 '12 at 19:00
?](http://stackoverflow.com/questions/611609/), [Ruby on Rails: How can i convert/replace every newline to '
'?](http://stackoverflow.com/questions/8405175/) – outis Jan 21 '12 at 19:02