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

rmWhitespace option not getting passed to ejs with express 4.x #358

Closed
watanas opened this issue Apr 4, 2018 · 5 comments
Closed

rmWhitespace option not getting passed to ejs with express 4.x #358

watanas opened this issue Apr 4, 2018 · 5 comments

Comments

@watanas
Copy link

watanas commented Apr 4, 2018

I'm running ejs@2.5.8 with express@4.16.3. I tried setting the rmWhitespace option:

app.set('view engine', 'ejs');
app.set('views', path.join(__dirname, 'views'));
app.locals.rmWhitespace = true;

My generated html file does not have whitespace removed. However, if I edit lib/ejs.js around line 463 so that it runs utils.shallowCopyFromList(opts, data, _OPTS_EXPRESS); even for express 4.x, then I get the correct behavior. Is there a correct way to set the rmWhitespace option, or is this a bug?

@applefreak
Copy link

Also experiencing this, I used to do app.set('view options', { rmWhitespace: true }); on 2.5.6 and it works. But with 2.5.8 this breaks.

applefreak added a commit to applefreak/ejs that referenced this issue Apr 11, 2018
… via Express' application setting 'view options' property
@mde mde closed this as completed in aaa00de Apr 19, 2018
@mde
Copy link
Owner

mde commented Apr 19, 2018

This should be fixed in master now. Can you please verify that it's working as expected? If so, I'll push out a new version to NPM.

@applefreak
Copy link

@mde Yup, just tried master, it works. Thanks!

@mde
Copy link
Owner

mde commented Apr 19, 2018

Excellent, I'll publish to NPM. Thanks so much for your patience.

@mde
Copy link
Owner

mde commented Apr 19, 2018

Pushed to NPM, v2.5.9.

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

3 participants