On  8:44 PM - Thursday, January  3, Nathan Weizenbaum wrote:

> 
> Use the find_and_preserve helper. This replaces newlines within <pre> 
> tags with the HTML newline character, which Haml ignores. For example:
> 
> = find_and_preserve do
>   :markdown
>       stuff
> 
> - Nathan
> 
> jallen wrote:
> > I know there's already a lot of posts on this topic, but I can't find
> > a answer to this simple problem:
> >
> > What is the most elegant way to author code blocks in haml?
> >
> > So far using :markdown seems to get me the closest, but I still have
> > problems. Here's my example
> >
> >
> > :markdown
> >       <sample code>
> >       ...more sample code
> >
> > this generates
> >
> > <pre><code>&lt;sample code&gt;
> >   ...more sample code
> >   </code></pre>
> >
> > which is almost fine. The problem is the spaces that are prepended to
> > the "...more sample code" line - I don't want them! I know this can be
> > solved by pushing the sample code into a partial or a helper, but I'd
> > like to have it inline if possible. Any suggestions?

I been on this list maybe two weeks, and have seen this questioned asked
a good handful of times. Also see it hang up people else where who are
just getting into haml. Small suggestion might be to add this
information into the tutorial on the homepage. I know when I started to
convert my site that is what I went by to get me going. Then I hit
this myself. Not really knowing what I was looking for it took me a
while to find it in the docs.

--Greg

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to