Libsass: Option 'linefeed' is ignored in 'compressed' style

Created on 19 Nov 2018  ·  5Comments  ·  Source: sass/libsass

Option 'linefeed' is ignored in 'compressed' style (at least on Windows).

--output-style compressed --linefeed lf
Result: CR LF

--linefeed lf
Result: LF

This is very annoying when working with git.

version info:
node-sass 4.11.0 (Wrapper) [JavaScript]
libsass 3.5.4 (Sass Compiler) [C/C++]

Bug - Whitespace

Most helpful comment

@nschonni this is libsass :)

All 5 comments

@Hint-ru can you file an issue with libsass since it's compilation related, it wouldn't be something that can be fixed in this repo.

PS: generally for line endings with source control it's better to deal with them using gitattributes or git config https://help.github.com/articles/dealing-with-line-endings/

@nschonni this is libsass :)

Just checked this and libsass returns the correct line-feeds in the resulting css if the option is passed correctly. So this seems to be an issue with node-sass. @xzyfer can you transfer this issue?

Sorry, inaccurate bug report. It looks like problem in comments, which are copied as is (with original linefeed). But the final linefeed in the end of the file is valid (parameter dependent).

OK, I see, AFAICT comments and other AST nodes do preserve the input 1 to 1, so this seems valid. Although this is very lowest priority to fix from our standpoint, since it doesn't change the semantics. I would really suggest to use a .gitattributes file to solve your immediate problem!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

c0d3xpl0it picture c0d3xpl0it  ·  4Comments

ashleykolodziej picture ashleykolodziej  ·  3Comments

Nimce picture Nimce  ·  4Comments

sgbeal picture sgbeal  ·  13Comments

GottZ picture GottZ  ·  3Comments