[Rails] Textilize problems with line breaks

Dylan Markow
Sat, 25 Mar 2006 02:12:03 -0000

I''m having a problem formatting some text. I have a textarea that I
input my text into, which will then be put into an e-mail and sent out.

The problem I am having is when there is a single line break.
Multiple line breaks work fine (hitting enter twice), but single line
breaks don''t seem to work properly.

Take the following input:

Line1.

Line2.

Line3.
Line4.

Using <%= textilize @body %> gives me:

Line1.
Line2.
Line3.
Line4.

Knowing that there''s an issue in rails with hard_breaks and
textilize, I tried RedCloth.new(@body).to_html, which gave me:

Line1.

Line2.

Line3.Line4.

Am I missing something??