Closed lbain closed 10 years ago
From the README
:
Some templating languages, like Haml, will indent your HTML for you, which will mess up code formatted in <pre>
tags. When using Haml, either use the find_and_preserve
helper, the :preserve
filter, or add set :haml, { ugly: true }
in your config.rb
to turn off Haml's automatic indentation.
I have introduced a new :code
helper for Haml that will automatically handle whitespace correctly. See the README for this repo for how to use it. This is available in master
now and will be released with the 2.0 version of the gem.
Awesome, thanks so much!
I'm working on a site using middleman (very excited about it btw, only found it yesterday!), and I'd like to add syntax highlighting. I'm working in haml, and found the
when translated directly to haml
causes problems because of the whitespace. I played around with it a bit and found that prefixing the code with
:plain
makes everything play nicely (much thanks to this Google group)Would it be possible to check if the user is working with haml and then add the
:plain
prefix automatically? Perhaps something like what's happening for kramdown? I'm not sure I'm reading that code correctly though...