Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

%textarea issue #13

Closed
ar7hur opened this issue Dec 8, 2011 · 3 comments
Closed

%textarea issue #13

ar7hur opened this issue Dec 8, 2011 · 3 comments

Comments

@ar7hur
Copy link

ar7hur commented Dec 8, 2011

%textarea
   =  @title 

compiles to

function (context) {
    var fn;
    fn = function(context) {
      var c, e, o;
      o = [];
      e = HAML.escape;
      c = HAML.cleanValue;
      o.push("<textarea>undefined</textarea>");
      return o.join("\n");
    };
    return fn.call(HAML.context(context));
  }

This only happens with textareas... any idea what's happening ?

@netzpirat
Copy link
Collaborator

Thanks for reporting. This is an issue when preserving the content of the textarea. To work around this bug, you can simply use

%textarea= @title 

@ar7hur
Copy link
Author

ar7hur commented Dec 8, 2011

Thanks, the workaround works fine !

@netzpirat
Copy link
Collaborator

With the latest version, whitespace preservation for textarea and pre tags have evolved. According to the Ruby Haml documentation, automatic whitespace preservation only takes place if the assignment is on the same line like the tag:

%textarea= @title

whereas with

%textarea
  = @title

you have to take care of the preservation by yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants