# [./spec/render/attribute_spec.rb:23](../../../spec/render/attribute_spec.rb#L23) ## Input ```haml %span{"foo": 'bar'} ``` ## Faml, Haml ```html ``` ## Hamlit (Error) ```html Hamlit::SyntaxError ``` # [./spec/render/attribute_spec.rb:23](../../../spec/render/attribute_spec.rb#L23) ## Input ```haml - x = 'bar' %span{"foo": x} ``` ## Faml, Haml ```html ``` ## Hamlit (Error) ```html Hamlit::SyntaxError ``` # [./spec/render/attribute_spec.rb:23](../../../spec/render/attribute_spec.rb#L23) ## Input ```haml %span{'foo': 'bar'} ``` ## Faml, Haml ```html ``` ## Hamlit (Error) ```html Hamlit::SyntaxError ``` # [./spec/render/attribute_spec.rb:23](../../../spec/render/attribute_spec.rb#L23) ## Input ```haml - x = 'bar' %span{'foo': x} ``` ## Faml, Haml ```html ``` ## Hamlit (Error) ```html Hamlit::SyntaxError ``` # [./spec/render/attribute_spec.rb:52](../../../spec/render/attribute_spec.rb#L52) ## Input ```haml - h1 = {class: 'c1', id: ['id1', 'id3']} - h2 = {class: [{}, 'c2'], id: 'id2'} %span#main.content{h1, h2} hello ``` ## Faml, Haml ```html hello ``` ## Hamlit ```html hello ``` # [./spec/render/attribute_spec.rb:65](../../../spec/render/attribute_spec.rb#L65) ## Input ```haml %span.foo{class: :foo} ``` ## Faml, Haml ```html ``` ## Hamlit ```html ``` # [./spec/render/attribute_spec.rb:65](../../../spec/render/attribute_spec.rb#L65) ## Input ```haml %span.foo{class: "foo bar"} ``` ## Faml, Haml ```html ``` ## Hamlit ```html ``` # [./spec/render/attribute_spec.rb:65](../../../spec/render/attribute_spec.rb#L65) ## Input ```haml %span.foo{class: %w[foo bar]} ``` ## Faml, Haml ```html ``` ## Hamlit ```html ``` # [./spec/render/attribute_spec.rb:71](../../../spec/render/attribute_spec.rb#L71) ## Input ```haml %span.#foo{id: :bar} hello ``` ## Faml ```html hello ``` ## Haml (Error) ```html Illegal element: classes and ids must have values. ``` ## Hamlit (Error) ```html Expected to scan (?-mix:[a-zA-Z0-9_-]+) but got nil ``` # [./spec/render/attribute_spec.rb:75](../../../spec/render/attribute_spec.rb#L75) ## Input ```haml %span{class: "x\"y'z"} hello ``` ## Faml, Hamlit ```html hello ``` ## Haml ```html hello ``` # [./spec/render/attribute_spec.rb:92](../../../spec/render/attribute_spec.rb#L92) ## Input (with options={:format=>:xhtml}) ```haml - foo = true %span{foo: foo, bar: 1} hello ``` ## Faml, Haml ```html hello ``` ## Hamlit ```html hello ``` # [./spec/render/attribute_spec.rb:92](../../../spec/render/attribute_spec.rb#L92) ## Input (with options={:format=>:xhtml}) ```haml - h = {foo: true, bar: 1} %span{h} hello ``` ## Faml, Haml ```html hello ``` ## Hamlit ```html hello ``` # [./spec/render/attribute_spec.rb:99](../../../spec/render/attribute_spec.rb#L99) ## Input ```haml %span{foo: {bar: 1+2}} hello ``` ## Faml ```html hello ``` ## Haml, Hamlit ```html hello ``` # [./spec/render/attribute_spec.rb:103](../../../spec/render/attribute_spec.rb#L103) ## Input ```haml - attrs = { foo: 1, bar: { hoge: :fuga }, baz: true } %span{attrs} hello ``` ## Faml ```html hello ``` ## Haml ```html hello ``` ## Hamlit ```html hello ``` # [./spec/render/attribute_spec.rb:117](../../../spec/render/attribute_spec.rb#L117) ## Input ```haml - data = { foo: 1 } %span{foo: {bar: "x#{1}y"}} hello ``` ## Faml ```html hello ``` ## Haml, Hamlit ```html hello ``` # [./spec/render/attribute_spec.rb:124](../../../spec/render/attribute_spec.rb#L124) ## Input ```haml %span{foo: {bar: 1+2}} hello ``` ## Faml ```html hello ``` ## Haml, Hamlit ```html hello ``` # [./spec/render/attribute_spec.rb:157](../../../spec/render/attribute_spec.rb#L157) ## Input ```haml %span{foo: 1 , bar: 2} hello ``` ## Faml (Error) ```html Unmatched brace ``` ## Haml (Error) ```html Unbalanced brackets. ``` ## Hamlit ```html hello ``` # [./spec/render/attribute_spec.rb:166](../../../spec/render/attribute_spec.rb#L166) ## Input ```haml %span{data: {foo: 1, bar: 'baz', :hoge => :fuga, k1: { k2: 'v3' }}} hello ``` ## Faml, Haml ```html hello ``` ## Hamlit ```html hello ``` # [./spec/render/attribute_spec.rb:174](../../../spec/render/attribute_spec.rb#L174) ## Input ```haml %span{data: {foo: 1, bar: 2+3}} hello ``` ## Faml, Haml ```html hello ``` ## Hamlit ```html hello ``` # [./spec/render/attribute_spec.rb:178](../../../spec/render/attribute_spec.rb#L178) ## Input ```haml - data = { foo: 1, bar: 2 } %span{data: data} hello ``` ## Faml, Haml ```html hello ``` ## Hamlit ```html hello ``` # [./spec/render/attribute_spec.rb:186](../../../spec/render/attribute_spec.rb#L186) ## Input ```haml %span{b: __LINE__, a: __LINE__} ``` ## Faml, Haml ```html ``` ## Hamlit ```html ``` # [./spec/render/attribute_spec.rb:212](../../../spec/render/attribute_spec.rb#L212) ## Input ```haml %span{data: {foo: 1, bar: 2}} %span hello ``` ## Faml, Haml ```html hello ``` ## Hamlit ```html hello ``` # [./spec/render/attribute_spec.rb:220](../../../spec/render/attribute_spec.rb#L220) ## Input ```haml %span(foo=1 bar=3) hello ``` ## Faml, Haml ```html hello ``` ## Hamlit ```html hello ``` # [./spec/render/attribute_spec.rb:237](../../../spec/render/attribute_spec.rb#L237) ## Input ```haml %span(foo bar=1) hello ``` ## Faml, Haml ```html hello ``` ## Hamlit ```html hello ``` # [./spec/render/attribute_spec.rb:241](../../../spec/render/attribute_spec.rb#L241) ## Input ```haml %span(foo=1 bar='baz#{1 + 2}') hello ``` ## Faml, Haml ```html hello ``` ## Hamlit ```html hello ``` # [./spec/render/attribute_spec.rb:246](../../../spec/render/attribute_spec.rb#L246) ## Input ```haml %span(foo=1 bar="ba\"z") hello ``` ## Faml, Hamlit ```html hello ``` ## Haml ```html hello ``` # [./spec/render/attribute_spec.rb:246](../../../spec/render/attribute_spec.rb#L246) ## Input ```haml %span(foo=1 bar='ba\'z') hello ``` ## Faml, Hamlit ```html hello ``` ## Haml ```html hello ``` # [./spec/render/attribute_spec.rb:255](../../../spec/render/attribute_spec.rb#L255) ## Input ```haml %span(foo=1 3.14=3) hello ``` ## Faml (Error) ```html Invalid attribute list (missing attributename) ``` ## Haml (Error) ```html Invalid attribute list: "(foo=1 3.14=3)". ``` ## Hamlit ```html hello ``` # [./spec/render/attribute_spec.rb:259](../../../spec/render/attribute_spec.rb#L259) ## Input ```haml %span(foo=1 bar=) hello ``` ## Faml (Error) ```html Invalid attribute list (invalid variable name) ``` ## Haml (Error) ```html Invalid attribute list: "(foo=1 bar=)". ``` ## Hamlit ```html hello ``` # [./spec/render/attribute_spec.rb:271](../../../spec/render/attribute_spec.rb#L271) ## Input ```haml %span(b=__LINE__ a=__LINE__) ``` ## Faml ```html ``` ## Haml, Hamlit ```html ```