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 | |
---|
1 | var startsAsUrl = require('./starts-as-url');
|
---|
2 |
|
---|
3 | var WHITESPACE_PATTERN = /\\?\n|\\?\r\n/g;
|
---|
4 | var WHITESPACE_PREFIX_PATTERN = /(\()\s+/g;
|
---|
5 | var WHITESPACE_SUFFIX_PATTERN = /\s+(\))/g;
|
---|
6 |
|
---|
7 | var 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 |
|
---|
22 | module.exports = plugin;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.