|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
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.