source: imaps-frontend/node_modules/clean-css/lib/optimizer/level-1/value-optimizers/url-quotes.js@ 79a0317

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 
1var QUOTED_URL_PATTERN = /^url\(['"].+['"]\)$/;
2var QUOTED_URL_WITH_WHITESPACE_PATTERN = /^url\(['"].*[*\s()'"].*['"]\)$/;
3var QUOTES_PATTERN = /["']/g;
4var URL_DATA_PATTERN = /^url\(['"]data:[^;]+;charset/;
5
6var 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
22module.exports = plugin;
Note: See TracBrowser for help on using the repository browser.