Follow up: Haml no longer be blowing my spot
I just barely posted about Haml blowin my spot. Thanks to the kindness of a reader, Haml is no longer blowin my spot.
The problem
Imagine we have the following snippet:
This post.cached_content
contains some <pre>
tags. As a result, the contents get kind of skewed.
The fix
So, it seems you can do something like:
The key here is that we use ~
instead of =
to output stuff. Apparently this is an alias for Haml::Helpers.find_and_preserve. I actually didn’t see any documentation about this alias though.
Looking to the future
Nathan Weizenbaum also pointed out that “Incidentally, as of Haml 1.9 pre and textarea will automatically eschew indentation-management.” Sick!