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

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

Projects

None yet

2 participants

@jscheid
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
jscheid commented Jul 4, 2012

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

@netzpirat netzpirat closed this in eb5a63d Jul 4, 2012
@netzpirat
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
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