diff --git a/.eslintrc.yml b/.eslintrc.yml index 16e9005..eb1f0e4 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -32,7 +32,7 @@ rules: handle-callback-err: 2 # Postponed - indent: [ 2, 2, { VariableDeclarator: { var: 2, let: 2, const: 3 }, SwitchCase: 1 } ] + indent: [ 2, 2, { VariableDeclarator: { var: 2, let: 2, const: 3 }, SwitchCase: 1, ignoreComments: true, MemberExpression: off } ] # key-spacing: [ 2, { "align": "value" } ] keyword-spacing: 2 diff --git a/index.js b/index.js index 77abd5d..5c0d572 100644 --- a/index.js +++ b/index.js @@ -257,11 +257,10 @@ function compile(self) { self.re.schema_test = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'i'); self.re.schema_search = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'ig'); - self.re.pretest = RegExp( - '(' + self.re.schema_test.source + ')|' + - '(' + self.re.host_fuzzy_test.source + ')|' + - '@', - 'i'); + self.re.pretest = RegExp( + '(' + self.re.schema_test.source + ')|(' + self.re.host_fuzzy_test.source + ')|@', + 'i' + ); // // Cleanup diff --git a/lib/re.js b/lib/re.js index f9b9269..aa271bf 100644 --- a/lib/re.js +++ b/lib/re.js @@ -64,7 +64,7 @@ module.exports = function (opts) { '\\.(?!' + re.src_ZCc + '|[.]).|' + (opts && opts['---'] ? '\\-(?!--(?:[^-]|$))(?:-*)|' // `---` => long dash, terminate - : + : '\\-+|' ) + '\\,(?!' + re.src_ZCc + ').|' + // allow `,,,` in paths diff --git a/package.json b/package.json index fec6c02..43e5093 100644 --- a/package.json +++ b/package.json @@ -22,16 +22,16 @@ }, "devDependencies": { "ansi": "^0.3.0", - "autoprefixer-stylus": "^0.11.0", + "autoprefixer-stylus": "^0.14.0", "benchmark": "^2.1.0", - "browserify": "*", - "chai": "^3.5.0", - "coveralls": "^2.11.2", + "browserify": "^16.2.3", + "chai": "^4.2.0", + "coveralls": "^3.0.2", + "eslint": "^5.9.0", + "istanbul": "^0.4.5", "jade": "^1.11.0", - "eslint": "^3.8.0", - "istanbul": "*", "mdurl": "^1.0.0", - "mocha": "^3.1.2", + "mocha": "^5.2.0", "ndoc": "^5.0.1", "stylus": "~0.54.5", "tlds": "^1.166.0" diff --git a/support/tlds_2char_gen.js b/support/tlds_2char_gen.js index 95923a8..8398a06 100755 --- a/support/tlds_2char_gen.js +++ b/support/tlds_2char_gen.js @@ -8,6 +8,7 @@ /*eslint-disable no-console*/ +/*eslint-env es6*/ function toRanges(str) { var ranges = [], i; @@ -30,11 +31,7 @@ function toRanges(str) { return '[' + ranges.join('') + ']'; } -var tlds = require('tlds') - .filter(function (name) { - return /^[a-z]{2}$/.test(name); - }) - .sort(); +var tlds = require('tlds').filter(name => /^[a-z]{2}$/.test(name)).sort(); // // group by first letter @@ -42,8 +39,8 @@ var tlds = require('tlds') var result = []; -'abcdefghijklmnopqrstuvwxyz'.split('').forEach(function (letter) { - var list = tlds.filter(function (name) { return name[0] === letter; }); +'abcdefghijklmnopqrstuvwxyz'.split('').forEach(letter => { + var list = tlds.filter(name => name[0] === letter); if (!list.length) { return; } @@ -52,7 +49,7 @@ var result = []; return; } - result.push(letter + '[' + list.map(function (n) { return n[1]; }).join('') + ']'); + result.push(letter + '[' + list.map(n => n[1]).join('') + ']'); }); result = result.join('|'); diff --git a/test/test.js b/test/test.js index d1e4728..4a923d0 100644 --- a/test/test.js +++ b/test/test.js @@ -69,8 +69,8 @@ describe('not links', function () { it('line ' + (idx + 1), function () { assert.notOk(l.test(line), - '(should not find link in `' + line + '`, but found `' + - JSON.stringify((l.match(line) || [])[0]) + '`)'); + '(should not find link in `' + line + '`, but found `' + + JSON.stringify((l.match(line) || [])[0]) + '`)'); }); });