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

Some spaces between back-ticks are removed #12

Closed
PitWenkin opened this issue Jul 19, 2022 · 2 comments
Closed

Some spaces between back-ticks are removed #12

PitWenkin opened this issue Jul 19, 2022 · 2 comments
Assignees

Comments

@PitWenkin
Copy link

When using back-ticks to define template literals, no spaces should be stripped.

  1. Leading and trailing spaces as well as spaces around = (maybe other signs too) are however removed.

Un-minified code:

const string = ` This should be interpreted as normal string, and no space should be removed. Even if there is an = sign. `;
alert(string);

Minified code:

const string=`This should be interpreted as normal string,and no space should be removed.Even if there is an=sign.`;alert(string);

Expected minified code:

const string=` This should be interpreted as normal string, and no space should be removed. Even if there is an = sign. `;alert(string);
  1. When using variables, spaces after variables are removed while space before them are left

Un-minified code:

const word = 'This';
const string =  ` ${word} should be interpreted as normal string, and no space should be removed. Even if there is an = sign. `;
alert(string);

Minified code:

const word='This';const string=` ${word}should be interpreted as normal string,and no space should be removed.Even if there is an=sign.`;alert(string);

Expected minified code:

const word='This';const string=` ${word} should be interpreted as normal string,and no space should be removed.Even if there is an = sign. `;alert(string);
@leejo leejo self-assigned this Jul 26, 2022
@leejo
Copy link
Owner

leejo commented Jul 26, 2022

I'll see if i can do something about this, but i am increasingly becoming more and more frustrated with way this distribution works so am considering chucking it back into ADOPTME on CPAN. Will have an update sometime in the next couple of weeks.

leejo added a commit that referenced this issue Oct 3, 2022
they are literals, they shouldn't be faffed with. add some test coverage
here.

bump VERSION and Changes for CPAN release
@leejo
Copy link
Owner

leejo commented Oct 3, 2022

v2.10 on its way to CPAN

@leejo leejo closed this as completed Oct 3, 2022
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

No branches or pull requests

2 participants