haml/haml — pull request #800 by t-uda (2014-09-11 17:46:18+00:00)
Title: Unexpected removal of newline at the end of attribute value

This haml:

```unexpected-removal-newline.haml
%input{:value => "some string\r\n"}
```

produces the following html:

```unexpected-removal-newline.html

```

It seems that the method ```build_attributes``` uses ```Haml::Helpers.preserve``` in order to replace ```\n``` by ```
```. Thus, a newline at the end of an attribute value is removed because ```Haml::Helpers.preserve``` calls ```chomp```.

So, I made a patch.

* Does not use ```preserve``` in ```build_attributes```,
* Adds 2 related test cases.

In my environment, with both ```ruby 1.9.3p194``` and ```ruby 2.0.0p451```, I passed to all tests. I also confirmed I could apply my patch to the ```stable``` branch without a conflict.

Could you please consider merging my patch?

Thanks for a nice template engine!