mattn / emmet-vim

emmet for vim: http://emmet.io/
http://mattn.github.io/emmet-vim
MIT License
6.41k stars 411 forks source link

Bug with jsx object attributes #377

Closed GuillaumeLeclerc closed 7 years ago

GuillaumeLeclerc commented 7 years ago

Hello,

Here is what I have

input+div[style={{height: '100px'}}]

it is transformed to:

      <input />
      <div style="{{height:"></div>

and I expect:

      <input />
      <div style={{height: '100px'}}></div>

Am I missing something ?

mattn commented 7 years ago

Why not input+div[style="height: '100px'"]?

GuillaumeLeclerc commented 7 years ago

This is jsx. And this is forbidden. Moreover it would not work for custom components.

mattn commented 7 years ago

Well, I got your expected with input+div[style="height: '100px'"] in filetype=jsx.

GuillaumeLeclerc commented 7 years ago

asciicast

Did I need to enable something else to make it work ?

mattn commented 7 years ago

What? what the result is wrong? type attribute?

GuillaumeLeclerc commented 7 years ago

This is definitely not valid JSx

Here is the expected output (see my first message)

      <input />
      <div style={{height: '100px'}}></div>