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

Closing </script> tag in resize code closes script tag! #4980

Closed
gushogg-blake opened this issue Jun 6, 2020 · 2 comments
Closed

Closing </script> tag in resize code closes script tag! #4980

gushogg-blake opened this issue Jun 6, 2020 · 2 comments

Comments

@gushogg-blake
Copy link

This line closes the open script tag if Svelte code is delivered in an inline script: https://github.com/sveltejs/svelte/blob/master/src/runtime/internal/dom.ts#L278

The solution is to split the string up/put it in a variable so it doesn't appear literally, e.g. "</scr" + "ipt>".

@Conduitry
Copy link
Member

As I said on the PR, I don't think this is a bug, and is something your build process needs to be handling for all your code if you want to use an inline script.

@gushogg-blake
Copy link
Author

I don't necessarily disagree in principle, but implementing a general solution would involve doing a full parse to figure out which quotes to use, which seems like a lot of work, and assuming backticks for this particular case seems hacky and prone to breaking in the future. The counter-argument would be that it should be the project's responsibility to not break - it's like a PHP library file having a closing ?> tag with trailing whitespace, valid code but unnecessary and possibly problematic for users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants