slimit
slimit copied to clipboard
SlimIt breaks on unicode byteorder marks
Example: "jquery.blockUI.js" and "jquery.caret.min.js"
Both have the unicode byteorder mark "EF BB BF" before or after the first line of code. Result is:
Illegal character '\xbb' at 1:1 after LexToken(ID,'\xef',1,0) Illegal character '\xbf' at 1:2 after LexToken(ID,'\xef',1,0)
and errors in the browser with compressed versions of those: ERROR: ILLEGAL TOKEN
Hi,
Could you give me links to those particular files with BOMs?
http://malsup.github.com/jquery.blockUI.js and http://jcaret.googlecode.com/files/jquery.caret.1.02.min.js
Well, essentially this isn't slimit's fault, though it shouldn't break as BOMs are valid (at least in the correct position) I guess.
I agree. It's not the slimit's fault per se, but I don't mind adding BOM cleanup to Slimit. And thanks for the above links.
Illegal character '\xbb' at 1:10 after LexToken(ID,'\xef',1,9) Illegal character '\xbf' at 1:11 after LexToken(ID,'\xef',1,9)
аналогичная ошибка произошла при использовании в теле шаблона :
{% compress js %} {% endcompress %}
дело в том, что я скопировал script с web-страницы, где закрался спец-символ  Естественно в шаблоне его совсем не видно, поэтому я указал вместо него [invisible symbol BOM] И такое видимо, случается, даже почитав этот топик не сразу понял где ошибка, помогло только попеременное включение скриптов.
git вдобавок порезал мой пост...
Еще один момент:
Unexpected token (DIV, '/') at 1:231862 between LexToken(COLON,':',1,231860) and LexToken(BXOR,'^',1,231863)
"regex":"/^[0-9-()\ ]+$/" // <<-- ERROR
решение:
"regex":"/^[0-9-()\u0020]+$/" // <<-- RESOLVE