main
Last change
on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
512 bytes
|
Line | |
---|
1 | var startsAsUrl = require('./starts-as-url');
|
---|
2 |
|
---|
3 | var OptimizationLevel = require('../../../options/optimization-level').OptimizationLevel;
|
---|
4 |
|
---|
5 | var URL_PREFIX_PATTERN = /^url\(/i;
|
---|
6 |
|
---|
7 | var plugin = {
|
---|
8 | level1: {
|
---|
9 | value: function urlPrefix(_name, value, options) {
|
---|
10 | if (!options.level[OptimizationLevel.One].normalizeUrls) {
|
---|
11 | return value;
|
---|
12 | }
|
---|
13 |
|
---|
14 | if (!startsAsUrl(value)) {
|
---|
15 | return value;
|
---|
16 | }
|
---|
17 |
|
---|
18 | return value.replace(URL_PREFIX_PATTERN, 'url(');
|
---|
19 | }
|
---|
20 | }
|
---|
21 | };
|
---|
22 |
|
---|
23 | module.exports = plugin;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.