Use the #preserve helper. This replaces newlines in text with the HTML escape character for newlines, so Haml doesn't re-indent them. For example:
#markdown= preserve(@content) Alternately, render the Markdown server-side using one of the many Ruby Markdown libraries. - Nathan aaron wrote: > I would like to use Javascript Markdown renderer called Showdown. > HAML's normally pretty indenting is causing the Markdown formatted > text to render incorrectly. > > How can indenting be completely disabled / circumvented? > > With HAML, I am currently rendering: > > <...> > <div id='markdown'>This is line one. > > This is line two. > </div> > </...> > > What I need is: > > <...> > <div id='markdown'> > This is line one. > > This is line two. > </div> > </...> > > I could use ERB, but that would also require me to convert my layout > to ERB. I love HAML and would prefer not to do that. Any workarounds? > > Thanks! > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Haml" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/haml?hl=en -~----------~----~----~----~------~----~------~--~---
