The attached patch fixes a few bugs, the main one being bug 2793027 commas in attributes. It also adds support for the html5 doctype with !!! 5. Additionally, there was a strict standards notice about the definition of SassRenderer::getInstance() not having the same argument types as the superclass, so I fixed that. The little change on HamlParser line 570 fixes a bug that missed some conversions to "} else {" if the whitespace was different.
The new regular expression to allow commas in attributes (see HamlParser lines 759-766) is not perfect. It will allow the value of an attribute to be one single-quoted string, one double-quoted string, or anything else that does not contain a comma or closing curly brace. It still would not allow something like this, for example:
%img{ :src => '/images/regex.png', :alt => $not_just_a_string . 'but an expression, including {braces} or comma' }
Patch fixing a few bugs, mainly 2793027