Hi, I''m using textilize with redcloth 3.0.4. Everything works best except that paragraphs are not translated as an HTML paragraph When I write something like: *first paragraph* second paragraph the output is without paragraph: *first paragraph* second paragraph Any help??? Thanks Jörg
=?ISO-8859-15?Q?J=F6rg?= wrote:> Hi, > > I''m using textilize with redcloth 3.0.4. Everything works best except > that paragraphs are not translated as an HTML paragraphAre you including newlines? i.e. "\n" Jake -- Posted via http://www.ruby-forum.com/.
Hi, Jörg, thats got to do with the hardcoded :hard_breaks in rails textilize helper: # 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 put your own helper in application_helper.rb, use that one and you should be fine: def tlize(text) text = RedCloth.new(text) return text.to_html end Regards Jan Jake Janovetz wrote:>=?ISO-8859-15?Q?J=F6rg?= wrote: > > >>Hi, >> >>I''m using textilize with redcloth 3.0.4. Everything works best except >>that paragraphs are not translated as an HTML paragraph >> >> > >Are you including newlines? i.e. "\n" > > Jake > > >
Jake Janovetz schrieb:>=?ISO-8859-15?Q?J=F6rg?= wrote: > > >>Hi, >> >>I''m using textilize with redcloth 3.0.4. Everything works best except >>that paragraphs are not translated as an HTML paragraph >> >> > >Are you including newlines? i.e. "\n" > > Jake > > >No, new lines do work. It''s only when seperating text by a blank line the text should be a paragraph, that does not work. Jörg i.e.: This is what I write into my textarea: *test* test this is what comes out: *test *test and this it what should come out (http://hobix.com/textile/): *test* test thanks for any help!!!
> put your own helper in application_helper.rb, use that one and you > should be fine: > > def tlize(text) > text = RedCloth.new(text) > return text.to_html > end > > Regards > Jan >Hi Jan, thanks for the answer, now paragraphs work but new lines do not?! : ) do you have another glue? Thanks
Ahh, thats interesting, seems as if its kind of an ''alternative'' thing. maybe you''ll find something on redcloth forums or mailing-lists (there surely are some?) or might try something like: def tlize(text) text.gsub!( /(.*)(\n)/, ''\1<br />'' ) text = RedCloth.new(text) return text.to_html end the regex might be quite naive (n00b), if you''ve got something better tell us! Regards Jan Jörg wrote:> >> put your own helper in application_helper.rb, use that one and you >> should be fine: >> >> def tlize(text) >> text = RedCloth.new(text) >> return text.to_html >> end >> >> Regards >> Jan >> > Hi Jan, > > thanks for the answer, now paragraphs work but new lines do not?! : ) > do you have another glue? > > Thanks >
On Dec 21, 2005, at 4:49 AM, Jörg wrote:> Hi, > > I''m using textilize with redcloth 3.0.4. Everything works best > except that paragraphs are not translated as an HTML paragraph > > When I write something like: > > *first paragraph* > > second paragraph > > the output is without paragraph: > > *first paragraph* > second paragraph > > Any help??? Thanks > > Jörg >Redcloth 3.0.4 is b0rked. Everything will work as expected if you downgrade to Redcloth 3.0.3 Cheers- -Ezra Zygmuntowicz Yakima Herald-Republic WebMaster http://yakimaherald.com 509-577-7732 ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org
thanks a lot, this just cropped up on me too. On 12/21/05, Ezra Zygmuntowicz <ezra-SD1UcFUIF7QjH4SCZfkgnw@public.gmane.org> wrote:> > On Dec 21, 2005, at 4:49 AM, Jörg wrote: > > > Hi, > > > > I''m using textilize with redcloth 3.0.4. Everything works best > > except that paragraphs are not translated as an HTML paragraph > > > > When I write something like: > > > > *first paragraph* > > > > second paragraph > > > > the output is without paragraph: > > > > *first paragraph* > > second paragraph > > > > Any help??? Thanks > > > > Jörg > > > > > Redcloth 3.0.4 is b0rked. Everything will work as expected if you > downgrade to Redcloth 3.0.3 > > > Cheers- > -Ezra Zygmuntowicz > Yakima Herald-Republic > WebMaster > http://yakimaherald.com > 509-577-7732 > ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- => the blog from beyond <=> www.eyeheartzombies.com <=
Ezra Zygmuntowicz schrieb:> > On Dec 21, 2005, at 4:49 AM, Jörg wrote: > >> Hi, >> >> I''m using textilize with redcloth 3.0.4. Everything works best >> except that paragraphs are not translated as an HTML paragraph >> >> When I write something like: >> >> *first paragraph* >> >> second paragraph >> >> the output is without paragraph: >> >> *first paragraph* >> second paragraph >> >> Any help??? Thanks >> >> Jörg >> > > > Redcloth 3.0.4 is b0rked. Everything will work as expected if you > downgrade to Redcloth 3.0.3 > > > Cheers- > -Ezra Zygmuntowicz > Yakima Herald-Republic > WebMaster > http://yakimaherald.com > 509-577-7732 > ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > >yea, thanks too, 3.0.3 works best!