File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -250,11 +250,13 @@ func (c *cssMinifier) minifyGrammar() {
250
250
c .w .Write (value )
251
251
semicolonQueued = true
252
252
case css .CommentGrammar :
253
- if len (data ) > 5 && data [1 ] == '*' && data [2 ] == '!' {
253
+ if 5 < len (data ) && data [1 ] == '*' && data [2 ] == '!' {
254
254
c .w .Write (data [:3 ])
255
255
comment := parse .TrimWhitespace (parse .ReplaceMultipleWhitespace (data [3 : len (data )- 2 ]))
256
256
c .w .Write (comment )
257
257
c .w .Write (data [len (data )- 2 :])
258
+ } else if 5 < len (data ) && (data [2 ] == '#' || data [2 ] == '@' ) {
259
+ c .w .Write (data ) // sourceMappingURL
258
260
}
259
261
default :
260
262
c .w .Write (data )
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ func TestCSS(t *testing.T) {
18
18
}{
19
19
{"/*comment*/" , "" },
20
20
{"/*! bang comment */" , "/*!bang comment*/" },
21
+ {"/*# sourceMappingURL=url */" , "/*# sourceMappingURL=url */" },
21
22
{"a;" , "a" },
22
23
{"i{}/*! bang comment */" , "i{}/*!bang comment*/" },
23
24
{"i { key: value; key2: value; }" , "i{key:value;key2:value}" },
You can’t perform that action at this time.
0 commit comments