mgreter/sass2scss

Strange output when UTF-8 BOM is present

Opened this issue · 0 comments

saper commented

From sass/node-sass#1619

Running 7709939

m.saper.info> /home/saper/sw/sass2scss/sass2scss --version
v1.1.2-7-g7709
m.saper.info> git clone https://github.com/saper/node-sass-issue-1619/
Cloning into 'node-sass-issue-1619'...
remote: Enumerating objects: 7, done.
remote: Counting objects: 100% (7/7), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 7 (delta 2), reused 7 (delta 2), pack-reused 0
Unpacking objects: 100% (7/7), done.
m.saper.info> cd node-sass-issue-1619/
m.saper.info> git branch
* pure-utf-8
m.saper.info> /home/saper/sw/sass2scss/sass2scss < _config.sass | hd
00000000  24 62 61 63 6b 67 72 6f  75 6e 64 3a 20 62 6c 61  |$background: bla|
00000010  63 6b 3b                                          |ck;|

00000013
m.saper.info> /home/saper/sw/sass2scss/sass2scss < _config.sass | hd
m.saper.info> git checkout utf-8-bom
Branch 'utf-8-bom' set up to track remote branch 'utf-8-bom' from 'origin'.
Switched to a new branch 'utf-8-bom'
m.saper.info> vi _config.scss       
m.saper.info> /home/saper/sw/sass2scss/sass2scss < _config.sass | hd
00000000  ef bb bf 20 7b 7d 24 62  61 63 6b 67 72 6f 75 6e  |... {}$backgroun|
00000010  64 3a 20 62 6c 61 63 6b  3b                       |d: black;|
00000019

BOM should be banned, but maybe this should be somehow handled. In the end libsass complains:

m.saper.info> /home/saper/sw/libsass/sassc/bin/sassc -v
sassc: 3.6.1
libsass: 3.6.2
sass2scss: 1.1.1
sass: 3.5
m.saper.info> /home/saper/sw/sass2scss/sass2scss < _config.sass | /home/saper/sw/libsass/sassc/bin/sassc 
Error: Invalid CSS after "": expected 1 selector or at-rule, was "{}$background: blac"
        on line 1:1 of stdin
>>  {}$background: black;
   ^