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

Regression in 1.1.1 with two attributes and #{} in first #55

Closed
jscheid opened this issue Jul 4, 2012 · 3 comments
Closed

Regression in 1.1.1 with two attributes and #{} in first #55

jscheid opened this issue Jul 4, 2012 · 3 comments

Comments

@jscheid
Copy link

jscheid commented Jul 4, 2012

This input doesn't seem to work anymore in 1.1.1:

%div(foo="#{func('foo')}" bar="bar")

Diff between 1.1.0 and 1.1.1 output:

--- regression_1.1.0.js 2012-07-04 12:13:02.000000000 +0200
+++ regression_1.1.1.js 2012-07-04 12:14:31.000000000 +0200
@@ -2,11 +2,11 @@
   this.JST || (this.JST = {});
   this.JST["regression"] = (function(context) {
     return (function() {
-      var $o;
+      var $o, bar;

       $o = [];

-      $o.push("<div foo='" + (func('foo')) + "' bar='bar'></div>");
+      $o.push(("<div foo='" + (func('foo')))(bar = "bar'></div>"));

       return $o.join("\n").replace(/\s(\w+)='�true'/mg, ' $1').replace(/\s(\w+)='�false'/mg, '');
@jscheid
Copy link
Author

jscheid commented Jul 4, 2012

I forgot to mention that it doesn't work in 1.1.2 either.

@netzpirat
Copy link
Collaborator

The HTML style attributes are the weakest part of Haml-Coffee and have far less specs than the Ruby style attributes, because it seems that most people are using the Ruby style attributes and they are harder to parse because they lack an attribute separator. I was surprised that it worked at all before 1.1.1 (according to the docs only simple value assignment is supported), but it looks that they have also profited from the attribute parser rewriting started with 1.0.0.

Thanks for reporting. Version 1.1.3 is released that fixes the issue.

@jscheid
Copy link
Author

jscheid commented Jul 4, 2012

Works here, thanks for the quick fix!

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