emacs-evil / evil-surround

you will be surrounded (surround.vim for evil, the extensible vi layer)
Other
631 stars 61 forks source link

surround with tag does not work with dot inside tag name #155

Closed deviantfero closed 5 years ago

deviantfero commented 5 years ago

for example, if I try to surround <div></div> with <Table.Content>, the following will be the result

<Table.Content>
  <div></div>
<Table/>

the expected result would be

<Table.Content>
  <div></div>
<Table.Content/>
ninrod commented 5 years ago

Yes, I think that it would be nice for evil-surround to behave like you describe.

on the other hand, not to be nitpicky, but the spec says that: "Tag names are used within element start tags and end tags to give the element’s name. HTML elements all have names that only use characters in the range 0–9, a–z, and A–Z".

Is this name you are using allowed? does it really work? because according to the spec, "dots" are not allowed in tag names.

deviantfero commented 5 years ago

It is used all over in modern JSX libraries like react, here's a example on a couple of frameworks (there should be code samples in those URLs):

It's not a deal-breaker, but it would be really convenient to have this supported

ninrod commented 5 years ago

Yes, I see. It would be really useful.

ninrod commented 5 years ago

Solved through @deviantfero's PR (#156) in d210e1fc2cf1c2d095471cefa700a0d1703f4ab6