[Rails] Textilize problems with line breaks

Dorian Mcfarland
Sat, 25 Mar 2006 18:31:38 -0000

try:

sometext = RedCloth.new(@body, :hard_breaks)
sometext.to_html

although, judging by http://redcloth.rubyforge.org/rdoc/ that should be the
default behaviour, and the rails ''textilize'' method should
also do that by default:

    # File vendor/rails/actionpack/lib/action_view/helpers/text_helper.rb, line
84
84:         def textilize(text)
85:           if text.blank?
86:             ""
87:           else
88:             textilized = RedCloth.new(text, [ :hard_breaks ])
89:             textilized.hard_breaks = true if
textilized.respond_to?("hard_breaks=")
90:             textilized.to_html
91:           end
92:         end

I''ve had loads of problems with various platforms and hard_breaks.
what is your actual html output from the various options you tried?

> 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??
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails

--
--
I do things for love or money