You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The current extractTag util has a bug: parse5 is very html spec compliant, also when it comes to self-closing tags. That means that something like <SelfClosing /> <p>bla</p> will not parse as we would expect - the node would also span <p>bla</p> and more, until parse5 would see a real closing tag (</SelfClosing>).
The result of this bug is that it can mess up source mappings and therefore errors/warnings are shown in the wrong place.
Workaround
Don't use self closing components.
To Reproduce
Short Test that fails with the current implementation:
it('can extract with self-closing component before it',()=>{constextracted=extractTag('<SelfClosing /><style></style>','style');assert.equal(!!extracted,true);});
Expected behavior
Should work, because Svelte can also deal with it.
System (please complete the following information):
OS: -
IDE: VSCode
Plugin/Package: Svelte Beta
Additional Information
We can maybe switch to using the svelte compiler's parse output once the parser is more error forgiving (sveltejs/svelte#4818)
The text was updated successfully, but these errors were encountered:
sveltejs#194
Now using the html language service which provides a simple parse method which does the tag nesting logic for us, we then have to do additional checks that we are not inside a moustache tag.
* (fix) can extract with self-closing component before it
#194
Now using the html language service which provides a simple parse method which does the tag nesting logic for us, we then have to do additional checks that we are not inside a moustache tag.
Describe the bug
The current
extractTag
util has a bug:parse5
is very html spec compliant, also when it comes to self-closing tags. That means that something like<SelfClosing /> <p>bla</p>
will not parse as we would expect - the node would also span<p>bla</p>
and more, untilparse5
would see a real closing tag (</SelfClosing>
).The result of this bug is that it can mess up source mappings and therefore errors/warnings are shown in the wrong place.
Workaround
Don't use self closing components.
To Reproduce
Short Test that fails with the current implementation:
Expected behavior
Should work, because Svelte can also deal with it.
System (please complete the following information):
Additional Information
We can maybe switch to using the svelte compiler's parse output once the parser is more error forgiving (sveltejs/svelte#4818)
The text was updated successfully, but these errors were encountered: