Writing a little Sinatra app and using haml for my layout. I've got some 
markdown text I'm parsing elsewhere, and then trying to render with HAML, 
but for my blocks of code, I'm getting too much indentation after the first 
line of code.

This seems to be a semi-common issue and so I'd read the solution is to wrap 
the yield in a call to find_and_preserve(). This gives slightly different 
output (the second line is now only indented by 2, instead of 4, spaces), 
but obviously not what I'm trying to accomplish. Any ideas?


layout.haml
!!! 5
    %body
        = find_and_preserve(yield)


index.haml
=@the_html_from_md



app.rb
get '/' do
    @the_html_from_md = …
    haml :index
end



Markdown:

This is a line

    first line of code
    second line of code


Output:

<!DOCTYPE html>
<html lang='en'>
  <body

      <pre><code>First line of code  second line of code  </code></pre>
  </body>
</html>

-- 
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/haml/-/fFXCdeYhGOUJ.
To post to this group, send email to haml@googlegroups.com.
To unsubscribe from this group, send email to haml+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/haml?hl=en.

Reply via email to