Closed acthp closed 12 years ago
with better formatting
> a=haml.compile('%table\n\t%tr')
'"<table>" + \n"</table>" +\n"<tr>" + \n"</tr>"'
> a=haml.compile('%table\n %tr')
'"<table>" + \n"</table>" +\n"<tr>" + \n"</tr>"'
> a=haml.compile('%table\n %tr')
'"<table>" + \n"<tr>" + \n"</tr>" + \n"</table>"'
This is the expected behavior. Only two-space indent is valid in creating a new context.
It isn't really haml, then, is it?
> echo $'%table\n\t%tr' | ~/.gem/ruby/1.8/bin/haml
<table>
<tr></tr>
</table>
> echo $'%table\n %tr' | ~/.gem/ruby/1.8/bin/haml
<table>
<tr></tr>
</table>
echo $'%table\n %tr' | ~/.gem/ruby/1.8/bin/haml
<table>
<tr></tr>
</table>
This should at least be loudly documented, since haml files aren't processed correctly, and it's different from other languages with syntactic white space.
if you make tests, add a flag or property to enable this behavior and change the regexp on line 476 (the two spaces before the "(.*)" ), i'll accept a pull request.
Not sure about this, but I didn't expect it. Two space indent is handled differently than one space indent or tab.