source: imaps-frontend/node_modules/clean-css/lib/optimizer/level-1/value-optimizers/url-whitespace.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: 520 bytes
Line 
1var startsAsUrl = require('./starts-as-url');
2
3var WHITESPACE_PATTERN = /\\?\n|\\?\r\n/g;
4var WHITESPACE_PREFIX_PATTERN = /(\()\s+/g;
5var WHITESPACE_SUFFIX_PATTERN = /\s+(\))/g;
6
7var plugin = {
8 level1: {
9 value: function urlWhitespace(_name, value) {
10 if (!startsAsUrl(value)) {
11 return value;
12 }
13
14 return value
15 .replace(WHITESPACE_PATTERN, '')
16 .replace(WHITESPACE_PREFIX_PATTERN, '$1')
17 .replace(WHITESPACE_SUFFIX_PATTERN, '$1');
18 }
19 }
20};
21
22module.exports = plugin;
Note: See TracBrowser for help on using the repository browser.