Fixed, pushed. Thanks for the bug report!

Lawrence Pit wrote:
>
> After some debugging I found the culprit. I'm using Haml 2.0.1 as a 
> gem btw.
>
> I have standardista from mislav installed, and it contains this piece 
> of code:
>
>
> if ENV['RAILS_ENV'] == 'production'
>   # HTML is whitespace-insensitive markup language;
>   # I don't care if the tags are properly indented in production
>   Haml::Template::options[:ugly] = true
>
>
> Because the :ugly option is set to true, Haml will flatten text in 
> precompiler#push_flat when building up the @filter_buffer. This 
> @filter_buffer is passed to the Sass engine. I.e., the input to the 
> sass engine is already without leading spaces on each line which leads 
> to the error message given. It seems to me that haml is flattening 
> text prematurely.
>
>
>
>
> Lawrence
>
>> No, I've never heard of this. I can't imagine why it would happen; the 
>> only time production/development modes affect Haml or Sass is by 
>> changing the default values of a few options, none of which have 
>> anything to do with this. What version of Haml are you using?
>>
>> Lawrence Pit wrote:
>>   
>>> Hi,
>>>
>>> I've got the following piece of code in my haml template:
>>>
>>>
>>>     %style{ :type => "text/css" }
>>>       :sass
>>>         #wrapper
>>>           :display none
>>>
>>>
>>> This works fine in rails in development mode. But to my surprise, in 
>>> production this fails with the following error message:
>>>
>>>
>>>     Attributes aren't allowed at the root of a document.
>>>
>>>
>>> Is that a (known) bug?
>>>
>>>
>>>
>>> Lawrence
>>>
>>>     
>>>   
>>>     
>>
>>
>>
>>
>>   
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to