You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed some strange behaviors when using a space between an attribute and its :.
/ Works well.
%span.value{ 'foo': 'foo', 'bar': 'bar', baz: 'baz' } Foo
/ <span class="value" foo="foo" bar="bar" baz="baz">Foo</span>/ Throws error. ExecJS::ProgramError: Unable to parse tag./ %span.value{ 'foo' : 'foo', 'bar' : 'bar', baz: 'baz' } Foo/ It only throw error when the space is after the first attribute !?/ Works weird: no error despite the space but fucked HTML.
%span.value{ 'foo': 'foo', 'bar' : 'bar', baz: 'baz' } Foo
/ <span class="value" foo="foo", "bar" :"bar" baz="baz">Foo</span>/ Less strange in data attribute: the attribute is just not displayed:
%span.value{ data: { 'foo' : 'foo', 'bar': 'bar' } } Foo
/ <span class="value" data-bar="bar">Foo</span>
So I stick with foo: 'foo' or 'foo-foo': 'foo' for keys.
But I thought it was important to point that bugs out as they can drive you crazy.
The text was updated successfully, but these errors were encountered:
The attribute parser is currently expecting the HAML Ruby 1.9 style tags to be in the strict format of { attr: value }, but it allows also (in contrast to the original HAML implementation) JSON style quoted attributes with either single or double quoutes: { 'attr': value } or { "attr": value }, and there must be no space in between the attribute name and the colon.
I'm currently in holiday mode, so I won't be able to have a closer look within the next two weeks, but it might be easily possible to extend the attribute parser to be fully JSON compatible. Thanks for reporting, I'll update the issue when I returned.
Just did a quick test and I found the bug to be fixed very easily. Haml_Coffee_Assets version 1.2.0 supports now all the reported JSON style attributes.
I noticed some strange behaviors when using a space between an attribute and its
:
.So I stick with
foo: 'foo'
or'foo-foo': 'foo'
for keys.But I thought it was important to point that bugs out as they can drive you crazy.
The text was updated successfully, but these errors were encountered: