class Haml::Buffer

def rstrip!

Doesn't do anything if we're at the beginning of a capture_haml block.
Remove the whitespace from the right side of the buffer string.
def rstrip!
  if capture_position.nil?
    buffer.rstrip!
    return
  end
  buffer << buffer.slice!(capture_position..-1).rstrip
end