Avoids single lint string concatenations and multi-line strings.
Change-Id: Iada91c1019cda87d48b13bdcff963d1950b54874
// We allow a trailing percent sign, which we just strip. This works fine
// if percents and regular numbers aren't being mixed.
- ts.numberRegex = new RegExp( '^(' + '[-+\u2212]?[0-9][0-9,]*(\\.[0-9,]*)?(E[-+\u2212]?[0-9][0-9,]*)?' + // Fortran-style scientific
- '|' + '[-+\u2212]?' + digitClass + '+[\\s\\xa0]*%?' + // Generic localised
- ')$', 'i' );
+ ts.numberRegex = new RegExp(
+ '^(' +
+ '[-+\u2212]?[0-9][0-9,]*(\\.[0-9,]*)?(E[-+\u2212]?[0-9][0-9,]*)?' + // Fortran-style scientific
+ '|' +
+ '[-+\u2212]?' + digitClass + '+[\\s\\xa0]*%?' + // Generic localised
+ ')$',
+ 'i'
+ );
}
function buildDateTable() {
ts.dateRegex[ 0 ] = new RegExp( /^\s*(\d{1,2})[\,\.\-\/'\s]{1,2}(\d{1,2})[\,\.\-\/'\s]{1,2}(\d{2,4})\s*?/i );
// Written Month name, dmy
- ts.dateRegex[ 1 ] = new RegExp( '^\\s*(\\d{1,2})[\\,\\.\\-\\/\'\\s]+(' + regex + ')' + '[\\,\\.\\-\\/\'\\s]+(\\d{2,4})\\s*$', 'i' );
+ ts.dateRegex[ 1 ] = new RegExp(
+ '^\\s*(\\d{1,2})[\\,\\.\\-\\/\'\\s]+(' +
+ regex +
+ ')' +
+ '[\\,\\.\\-\\/\'\\s]+(\\d{2,4})\\s*$',
+ 'i'
+ );
// Written Month name, mdy
- ts.dateRegex[ 2 ] = new RegExp( '^\\s*(' + regex + ')' + '[\\,\\.\\-\\/\'\\s]+(\\d{1,2})[\\,\\.\\-\\/\'\\s]+(\\d{2,4})\\s*$', 'i' );
+ ts.dateRegex[ 2 ] = new RegExp(
+ '^\\s*(' + regex + ')' +
+ '[\\,\\.\\-\\/\'\\s]+(\\d{1,2})[\\,\\.\\-\\/\'\\s]+(\\d{2,4})\\s*$',
+ 'i'
+ );
}
block = allowBlock ? '(?:\\/(?:12[0-8]|1[01][0-9]|[1-9]?\\d))?' : '';
RE_IPV6_ADD =
'(?:' + // starts with "::" (including "::")
- ':(?::|(?::' + '[0-9A-Fa-f]{1,4}' + '){1,7})' +
- '|' + // ends with "::" (except "::")
- '[0-9A-Fa-f]{1,4}' + '(?::' + '[0-9A-Fa-f]{1,4}' + '){0,6}::' +
- '|' + // contains no "::"
- '[0-9A-Fa-f]{1,4}' + '(?::' + '[0-9A-Fa-f]{1,4}' + '){7}' +
+ ':(?::|(?::' +
+ '[0-9A-Fa-f]{1,4}' +
+ '){1,7})' +
+ '|' + // ends with "::" (except "::")
+ '[0-9A-Fa-f]{1,4}' +
+ '(?::' +
+ '[0-9A-Fa-f]{1,4}' +
+ '){0,6}::' +
+ '|' + // contains no "::"
+ '[0-9A-Fa-f]{1,4}' +
+ '(?::' +
+ '[0-9A-Fa-f]{1,4}' +
+ '){7}' +
')';
if ( new RegExp( '^' + RE_IPV6_ADD + block + '$' ).test( address ) ) {
}
// contains one "::" in the middle (single '::' check below)
- RE_IPV6_ADD = '[0-9A-Fa-f]{1,4}' + '(?:::?' + '[0-9A-Fa-f]{1,4}' + '){1,6}';
+ RE_IPV6_ADD =
+ '[0-9A-Fa-f]{1,4}' +
+ '(?:::?' +
+ '[0-9A-Fa-f]{1,4}' +
+ '){1,6}';
return (
new RegExp( '^' + RE_IPV6_ADD + block + '$' ).test( address ) &&
$input: $( '<input>' ).attr( 'type', 'text' )
.byteLimit( 12 ),
sample: mbSample,
- expected: '1234567890' + '12'
+ expected: '123456789012'
} );
byteLimitTest( {
title = mw.Title.newFromImg( { src: thisCase.url } );
if ( thisCase.nameText !== undefined ) {
- prefix = '[' + thisCase.typeOfUrl + ' URL' + '] ';
+ prefix = '[' + thisCase.typeOfUrl + ' URL] ';
assert.notStrictEqual( title, null, prefix + 'Parses successfully' );
assert.equal( title.getNameText(), thisCase.nameText, prefix + 'Filename matches original' );
var pTestTb, pCustom, vectorTabs, tbRL, cuQuux, $cuQuux, tbMW, $tbMW, tbRLDM, caFoo,
addedAfter, tbRLDMnonexistentid, tbRLDMemptyjquery;
- pTestTb = '\
- <div class="portlet" id="p-test-tb">\
- <h3>Toolbox</h3>\
- <ul class="body"></ul>\
- </div>';
- pCustom = '\
- <div class="portlet" id="p-test-custom">\
- <h3>Views</h3>\
- <ul class="body">\
- <li id="c-foo"><a href="#">Foo</a></li>\
- <li id="c-barmenu">\
- <ul>\
- <li id="c-bar-baz"><a href="#">Baz</a></a>\
- </ul>\
- </li>\
- </ul>\
- </div>';
- vectorTabs = '\
- <div id="p-test-views" class="vectorTabs">\
- <h3>Views</h3>\
- <ul></ul>\
- </div>';
+ pTestTb =
+ '<div class="portlet" id="p-test-tb">' +
+ '<h3>Toolbox</h3>' +
+ '<ul class="body"></ul>' +
+ '</div>';
+ pCustom =
+ '<div class="portlet" id="p-test-custom">' +
+ '<h3>Views</h3>' +
+ '<ul class="body">' +
+ '<li id="c-foo"><a href="#">Foo</a></li>' +
+ '<li id="c-barmenu">' +
+ '<ul>' +
+ '<li id="c-bar-baz"><a href="#">Baz</a></a>' +
+ '</ul>' +
+ '</li>' +
+ '</ul>' +
+ '</div>';
+ vectorTabs =
+ '<div id="p-test-views" class="vectorTabs">' +
+ '<h3>Views</h3>' +
+ '<ul></ul>' +
+ '</div>';
$( '#qunit-fixture' ).append( pTestTb, pCustom, vectorTabs );