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

Empty if block with   #1658

Closed
kaisermann opened this issue Aug 16, 2018 · 3 comments · Fixed by #1683
Closed

Empty if block with   #1658

kaisermann opened this issue Aug 16, 2018 · 3 comments · Fixed by #1683

Comments

@kaisermann
Copy link
Member

REPL

The template:

{#if foo}
	 
{:else}
	<p>not foo!</p>
{/if}

Gives the following warning:
image

@Conduitry
Copy link
Member

Apparently /\S/ doesn't match the character that &nbsp; represents. We need to be more liberal with our definition of non-whitespace characters. Perhaps [^ \n\r\t]?

@kaisermann
Copy link
Member Author

According to regex101, the \S matches any non-whitespace character (equal to [^\r\n\t\f\v ]). That last empty space is the culprit...

@Rich-Harris
Copy link
Member

fixed in 2.12.1, thanks

kaisermann pushed a commit to kaisermann/svelte that referenced this issue Sep 19, 2018
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

Successfully merging a pull request may close this issue.

3 participants