Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax highlight incorrect when preceding component is self-closing #773

Closed
arxpoetica opened this issue Jan 18, 2021 · 3 comments
Closed
Labels
bug Something isn't working Fixed Fixed in master branch. Pending production release.

Comments

@arxpoetica
Copy link
Member

The syntax highlighting is incorrect when the preceding component is self-closing. (See screenshot below.)

You can copy the following code into a *.svelte file to see:

<SelfClosingComponent/>
<div>stuff</div> <!-- highlight problem with opening tag -->
<div>stuff</div> <!-- no highlight problem -->

<SelfClosingComponent/>
<meta/> <!-- highlight problem -->

<SelfClosingComponent/>
<div/> <!-- highlight problem, but also not valid html, so...??? -->

<SelfClosingComponent/>
<!-- <Intro/> --> <!-- highlight problem -->
<!-- <Intro/> --> <!-- returns to normal after problem -->

<SelfClosingComponent></SelfClosingComponent>
<div>stuff</div> <!-- no highlight problem when component has ending tag -->

Expected behavior
Highlight should return to normal behavior following self-closing components such as <SelfClosingComponent/>.

Screenshot
image

System (please complete the following information):

  • OS: MacOS Catalina v10.15.3
  • IDE: VSCode v1.52.1 Commit ea3859d4ba2f3e577a159bc91e3074c5d85c0523
  • Plugin/Package: Svelte for VSCode
@arxpoetica arxpoetica added the bug Something isn't working label Jan 18, 2021
@arxpoetica
Copy link
Member Author

Potentially related: #299

@pushkine
Copy link
Contributor

A simpler example

<div/>
<div></div>

Code_2021-01-22_18-04-16

It only happens if there is no space before the closing part
Code_2021-01-22_18-05-01

dummdidumm added a commit that referenced this issue Jan 24, 2021
- Fix highlighting break when there's no space between `name` and `/` (#773 )
- `/` is now part of `...definition.tag.end.svelte`
dummdidumm added a commit that referenced this issue Jan 25, 2021
- Fix highlighting break when there's no space between `name` and `/` (#773 )
- `/` is now part of `...definition.tag.end.svelte`
@dummdidumm dummdidumm added the Fixed Fixed in master branch. Pending production release. label Jan 25, 2021
@arxpoetica
Copy link
Member Author

Woo hoo! Thanks @dummdidumm!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Fixed Fixed in master branch. Pending production release.
Projects
None yet
Development

No branches or pull requests

3 participants