nex3/haml — Issue #497: Leading Line Break in Rails-3-2-stable breaks TextAreas
Author: visoft
Created: 2012-03-09 22:31:24+00:00
State: open

I have been testing with Rails-3-2-stable and found a problem that was introduced with [Rails Issue 5191](https://github.com/rails/rails/pull/5191). A line break was added after a TextArea tag for [Rails Issue 393](https://github.com/rails/rails/issues/393) and [Rails Issue 4000](https://github.com/rails/rails/pull/4000).

When rendering a textarea with HAML, the string that comes out is prefixed with a encoded newline character
. Since this is a literal character as part of the string, it causes a blank line within the textarea. I initially thought this was a simple_form problem ([see #513](https://github.com/plataformatec/simple_form/issues/513)), but after further testing, I discovered it happened with all forms.

You can find an example of the problem in my project https://github.com/visoft/SimpleFormIssue513.

The rendered HTML comes out like this:

``` HTML

This is a test
```

Where it should be:

``` HTML

This is a test
```

If you don't see the issue, try another one, see [this comment](https://github.com/plataformatec/simple_form/issues/513#issuecomment-4421124), or you can look at the rendered source code where you will see the `
` being rendered.