-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
preserveWhitespace strips prefix space #4731
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
Comments
I'm trying to make near-byte-perfect SSR output because we might be involved in the Creative Commons static site generator of the Licenses (the deeds and legalcode). Because this is quite a project (with many languages), I wanted to verify the Svelte (Sapper) output with the current situation (both compared to the code live and in the repo). Because both comments and whitespace is not working like expected: whitespace is stripped in this case: <div>
<div>
<p> Some text </p>
</div>
</div> to <div><div><p>Some text </p></div> however, there is a 'trick': <div><!---->
<div><!---->
<p><!----> Some text </p>
</div><!---->
</div> this will the desired output: <div>
<div>
<p> Some text </p>
</div>
</div> and it is what I'm currently doing in a PoC to get the compare working. The main function involved in stripping whitespace is This ssr I also had issues with tags like I think the option |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Can we please disable this stupid bot? |
This should be fixed in 3.46.4. |
…tejs#6990) Fixes sveltejs#6437 Fixes sveltejs#4731 Closes sveltejs#4737 Whitespace is now untouched inside <pre> tag and other tags if preserveWhitespace is true
…tejs#6990) Fixes sveltejs#6437 Fixes sveltejs#4731 Closes sveltejs#4737 Whitespace is now untouched inside <pre> tag and other tags if preserveWhitespace is true
…tejs#6990) Fixes sveltejs#6437 Fixes sveltejs#4731 Closes sveltejs#4737 Whitespace is now untouched inside <pre> tag and other tags if preserveWhitespace is true
…tejs#6990) Fixes sveltejs#6437 Fixes sveltejs#4731 Closes sveltejs#4737 Whitespace is now untouched inside <pre> tag and other tags if preserveWhitespace is true
…tejs#6990) Fixes sveltejs#6437 Fixes sveltejs#4731 Closes sveltejs#4737 Whitespace is now untouched inside <pre> tag and other tags if preserveWhitespace is true
Describe the bug
The compiler option
preserveWhitespace: true
strips prefix space:To Reproduce
See this repo. With minimal changes from the svelte/template. This is my output with missing prefix space.
Expected behavior
Keep the prefix whitespace in the SSR.
Information about your Svelte project:
svelte-3.21.0 & rollup.
The text was updated successfully, but these errors were encountered: