Only drop the BOM when it's the first character.
authorMihai Bazon <mihai.bazon@gmail.com>
Tue, 5 May 2015 07:11:38 +0000 (10:11 +0300)
committerMihai Bazon <mihai.bazon@gmail.com>
Tue, 5 May 2015 07:11:38 +0000 (10:11 +0300)
Close #704

lib/parse.js

index 53aaabd..3cc2da5 100644 (file)
@@ -213,7 +213,7 @@ var EX_EOF = {};
 function tokenizer($TEXT, filename, html5_comments) {
 
     var S = {
-        text            : $TEXT.replace(/\uFEFF/g, ''),
+        text            : $TEXT.replace(/^\uFEFF/g, ''),
         filename        : filename,
         pos             : 0,
         tokpos          : 0,