-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
svelte-package removes type="application/ld+json" from script tags #6862
Comments
The cause of this is that parsing script blocks to pass to preprocessors is done in a very fast and simplistic way. It also finds script tags nested in strings. The workaround you linked to breaks apart the script tags in the sourcecode, so that they are not found by the parser, not passed through svelte-preprocess - which ultimately strips the type. You already found the preserve option, but i think it would have to be
so for now if you have to inject script tags via In a future version of svelte and/or svelte-preprocess, the way script tags are processed might change to avoid this. There isn't much sveltekit or svelte-package could do about this, the issue should be transferred to either svelte or svelte-preprocess repo, or maybe closed with a ref to an existing issue related to this |
@dominikg okay, yeah I think passing preserve should preserve the attributes as well so svelte-preprocess might be the right place. Agree about injecting script tags not being ideal yet that's how they decided to distribute the graph data. |
This is a bug in |
* [fix] don't strip type="application/.." tags Fixes #6862 * changeset
Yup, fixed with the latest package, amazing - thanks! |
Describe the bug
Running
svelte-package
removestype="application/ld+json"
from script tags even withpreserve: ['ld+json']
using:is compiled to:
Reproduction
https://github.com/TeemuKoivisto/svelte-package-removes-jsonld-type
Logs
No response
System Info
Severity
serious, but I can work around it
Additional Information
No response
The text was updated successfully, but these errors were encountered: