question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Inconsistent spacing between two copies of same code

See original GitHub issue

Describe the bug

Spaces are added to the Svelte output causing the rendered text not to appear as expected (for example, looping over and outputting characters in a string).

To Reproduce

REPL: https://svelte.dev/repl/86aa94c8350845e794b27ea9f75624e9?version=3.35.0

<script>
	let name = 'Hello world';
</script>

{#each name as character}
	<span>
		{#if character == "l"}
			A
		{:else}
			B
		{/if}
	</span>
{/each}

{#each name as character}
	<span>
		{#if character == "l"}
			A
		{:else}
			B
		{/if}
	</span>
{/each}
Screen Shot 2021-03-22 at 11 22 35 PM

Expected behavior There should be no spaces in the output.

  • Your browser and the version: (e.x. Chrome 52.1, Firefox 48.0, IE 10)

Safari 14.1 Edge 89.0.774.57

  • Your operating system: (e.x. OS X 10, Ubuntu Linux 19.10, Windows XP, etc)

macOS 11

  • Svelte version (Please check you can reproduce the issue with the latest release!)

Svelte 3.35.0

  • Whether your project uses Webpack or Rollup

Rollup, reproduced with Repl

Severity How severe an issue is this bug to you? Is this annoying, blocking some users, blocking an upgrade or blocking your usage of Svelte entirely?

This bug is blocking a secondary feature of my website. I am building a preview of formatted text, and need to be able to loop over text and show each one in its own <span>. Only spaces in the source text should appear in the HTML.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:3
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
stalkergcommented, Mar 26, 2021

ok, I know why it’s happens

0reactions
stale[bot]commented, Jun 26, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Odd spacing issue within paragraphs (i.e. across lines)
Hello all, I'm having a completely inconsistent issue with my spacing within paragraphs, despite having standard settings for my paragraph ...
Read more >
Inconsistent Spacing Between Separate Equations - TeX
1 Answer 1 · How did you get the second block of code in your answer? – steve · 1 · You should...
Read more >
Inconsistent use of spaces and tabs in Python - Stack Overflow
the program runs. I tried both adding that line with 4 spaces and when that didn't work I added it with one tab....
Read more >
Uneven spacing between texts in command window?? help!!!
I ran the same code on "MATlab online"(scroll horizontally) and you can see the visual difference between two outputs. how can i change...
Read more >
Inconsistent spacing in table of content headings - Super User
Looks like an issue with spacing, probably the tabs (using show/hide code button in paragraph section of ribbon to show formatting would show...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found