ejs icon indicating copy to clipboard operation
ejs copied to clipboard

Strange behavior with rmWhiteSpace

Open manu-st opened this issue 7 years ago • 2 comments

If I enable rmWhiteSpace, then for some of my .ejs files, it concatenates 2 consecutive lines into one. So far I only noticed this with .ejs files containing javascript code such as the following:

        $form.find('.submit').prop('disabled', false);  // Re-enable submission
    } else {

it would generate

        $form.find('.submit').prop('disabled', false);  // Re-enable submission} else {

which of course doesn't mean the same thing.

Is this expected and this is a misunderstanding of what rmWhiteSpace is supposed to do, or is it a bug?

Thanks!

manu-st avatar May 23 '17 19:05 manu-st

I'd call that a bug. Are you using CRLF line endings?

RyanZim avatar May 23 '17 19:05 RyanZim

I'm definitely using CRLF on my test machine, but the server is running Linux and files only contain LF and I have the same behavior. The file where I have the problem is used via an EJS include in case it matters (the old way <% include ../../file.ejs %>).

manu-st avatar May 23 '17 19:05 manu-st