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.

Extra space concatenated between text and expression

See original GitHub issue

I’m using template literal in my class attribute class={`resizer resizer--${axe}`}. It get preprocessed as class="resizer resizer-- {axe}" (notice the space between -- and {axe}).

I’ve dug into the code and found out these two lines. They introduce an extra space between the text and expression part of the attribute.

https://github.com/windicss/svelte-windicss-preprocess/blob/12c4040476569b839e60350bb5ab29d9e751127c/src/index.ts#L135 https://github.com/windicss/svelte-windicss-preprocess/blob/12c4040476569b839e60350bb5ab29d9e751127c/src/index.ts#L141

Am I missing something, a limitation of the preprocessor with template literal perhaps?

I’d be happy to create a PR to remove the space there.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
alexanderniebuhrcommented, Mar 4, 2021

pls try and submit pr, i will review (i am currently working on new tests… sorry for short answers)

0reactions
grenierdevcommented, Mar 5, 2021

Settled with class="resizer {'resizer--'+axe}"

Read more comments on GitHub >

github_iconTop Results From Across the Web

CONCATENATE function - Microsoft Support
Without designated spaces between separate text entries, the text entries will run together. Add extra spaces as part of the CONCATENATE formula. There...
Read more >
How can a space be added with string concatenation?
Hello, one other way that you can add a space is by adding a space in between animal and '. For example: let...
Read more >
Adjusting 1 space between two strings using python
Simply just add a space between the two strings: a = "abcd" b = "xyz" c = a + " " + b...
Read more >
how to add extra space between two strings in a trigger?
Hey Sadik, You can concatenate a string with ' ' (1 space). You can add any number of spaces between two strings. String...
Read more >
Concatenating string fields with one space between them - IBM
This means they cannot simply be concatenated since there may be more than one space between the two names. First, a RIGHT TRIM...
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