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:
622 bytes
|
Line | |
---|
1 | var QUOTED_URL_PATTERN = /^url\(['"].+['"]\)$/;
|
---|
2 | var QUOTED_URL_WITH_WHITESPACE_PATTERN = /^url\(['"].*[*\s()'"].*['"]\)$/;
|
---|
3 | var QUOTES_PATTERN = /["']/g;
|
---|
4 | var URL_DATA_PATTERN = /^url\(['"]data:[^;]+;charset/;
|
---|
5 |
|
---|
6 | var plugin = {
|
---|
7 | level1: {
|
---|
8 | value: function urlQuotes(_name, value, options) {
|
---|
9 | if (options.compatibility.properties.urlQuotes) {
|
---|
10 | return value;
|
---|
11 | }
|
---|
12 |
|
---|
13 | return QUOTED_URL_PATTERN.test(value)
|
---|
14 | && !QUOTED_URL_WITH_WHITESPACE_PATTERN.test(value)
|
---|
15 | && !URL_DATA_PATTERN.test(value)
|
---|
16 | ? value.replace(QUOTES_PATTERN, '')
|
---|
17 | : value;
|
---|
18 | }
|
---|
19 | }
|
---|
20 | };
|
---|
21 |
|
---|
22 | module.exports = plugin;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.