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

not minifying line breaks after function end #87

Open
columbian-chris opened this issue Aug 2, 2019 · 2 comments
Open

not minifying line breaks after function end #87

columbian-chris opened this issue Aug 2, 2019 · 2 comments

Comments

@columbian-chris
Copy link

JShrink doesn't appear to be removing line breaks after the end of a function.

Example:

	window.dataLayer = window.dataLayer || [];
	function gtag(){dataLayer.push(arguments);}
	gtag('js', new Date());

...becomes...

window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments);}
gtag('js',new Date());

Notice the line break not removed after the } character.

@bramaudi
Copy link

You can remove all line break in result with something like this

$result = str_replace("\n", '', $result);

@columbian-chris
Copy link
Author

I understand I could do a string replace to remove all extraneous line breaks after I run through the minifier, but I'm trying to point out that this is a bug that should be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants