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
System (please complete the following information):
Potentially related: https://github.com/sveltejs/language-tools/issues/299
A simpler example
<div/>
<div></div>
It only happens if there is no space before the closing part
Woo hoo! Thanks @dummdidumm!