File tree Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 2121 ` \E9clair ` are parsed to the same value. See
2222 [ the proposal] [ identifier-escapes ] for details.
2323
24+ * Don't choke on a [ byte-order mark] [ ] at the beginning of a document when
25+ running in JavaScript.
26+
2427[ math functions ] : https://drafts.csswg.org/css-values/#math-function
2528[ css-import ] : https://github.com/sass/language/blob/master/accepted/css-imports.md
2629[ css-min-max ] : https://github.com/sass/language/blob/master/accepted/min-max.md
2730[ media-ranges ] : https://github.com/sass/language/blob/master/accepted/media-ranges.md
2831[ identifier-escapes ] : https://github.com/sass/language/blob/master/accepted/identifier-escapes.md
32+ [ byte-order mark ] : https://en.wikipedia.org/wiki/Byte_order_mark
2933
3034### Command-Line Interface
3135
Original file line number Diff line number Diff line change @@ -65,6 +65,8 @@ abstract class StylesheetParser extends Parser {
6565 Stylesheet parse () {
6666 return wrapSpanFormatException (() {
6767 var start = scanner.state;
68+ // Allow a byte-order mark at the beginning of the document.
69+ scanner.scanChar (0xFEFF );
6870 var statements = this .statements (() => _statement (root: true ));
6971 scanner.expectDone ();
7072 return new Stylesheet (statements, scanner.spanFrom (start),
Original file line number Diff line number Diff line change 33// https://opensource.org/licenses/MIT.
44
55import 'dart:async' ;
6+ import 'dart:io' ;
67
78import 'package:path/path.dart' as p;
89import 'package:test/test.dart' ;
@@ -44,6 +45,15 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
4445 await sass.shouldExit (0 );
4546 });
4647
48+ // Regression test for #437.
49+ test ("compiles a Sass file with a BOM to CSS" , () async {
50+ await d.file ("test.scss" , "\u FEFF\$ color: red;" ).create ();
51+
52+ var sass = await runSass (["test.scss" ]);
53+ expect (sass.stdout, emitsDone);
54+ await sass.shouldExit (0 );
55+ });
56+
4757 // On Windows, this verifies that we don't consider the colon after a drive
4858 // letter to be an `input:output` separator.
4959 test ("compiles an absolute Sass file to CSS" , () async {
You can’t perform that action at this time.
0 commit comments