// thumb.php-generated thumbnails
thumbPhpRegex = /thumb\.php/,
-
regexes = [
// Thumbnails
- /\/[a-f0-9]\/[a-f0-9]{2}\/([^\s\/]+)\/[0-9]+px-\1[^\s\/]*$/,
+ /\/[a-f0-9]\/[a-f0-9]{2}\/([^\s\/]+)\/[^\s\/]+-\1[^\s\/]*$/,
// Thumbnails in non-hashed upload directories
- /\/([^\s\/]+)\/[0-9]+px-\1[^\s\/]*$/,
+ /\/([^\s\/]+)\/[^\s\/]+-\1[^\s\/]*$/,
// Full size images
/\/[a-f0-9]\/[a-f0-9]{2}\/([^\s\/]+)$/,
assert.equal( title.getUrl(), '/wiki/User_talk:John_Doe', 'Escaping in title and namespace for urls' );
} );
- QUnit.test( 'newFromImg', 28, function ( assert ) {
+ QUnit.test( 'newFromImg', 36, function ( assert ) {
var title, i, thisCase, prefix,
cases = [
{
prefixedText: 'File:Anticlockwise heliotrope\'s.jpg'
},
+ {
+ url: '/wiki/images/thumb/8/80/Wikipedia-logo-v2.svg/langde-150px-Wikipedia-logo-v2.svg.png',
+ typeOfUrl: 'Normal hashed directory thumbnail with complex thumbnail parameters',
+ nameText: 'Wikipedia-logo-v2',
+ prefixedText: 'File:Wikipedia-logo-v2.svg'
+ },
+
{
url: '//upload.wikimedia.org/wikipedia/commons/thumb/8/80/Wikipedia-logo-v2.svg/150px-Wikipedia-logo-v2.svg.png',
typeOfUrl: 'Commons thumbnail',
prefixedText: 'File:Wikipedia-logo-v2.svg'
},
+ {
+ url: '/wikipedia/commons/thumb/Wikipedia-logo-v2.svg/langde-150px-Wikipedia-logo-v2.svg.png',
+ typeOfUrl: 'Commons unhashed thumbnail with complex thumbnail parameters',
+ nameText: 'Wikipedia-logo-v2',
+ prefixedText: 'File:Wikipedia-logo-v2.svg'
+ },
+
{
url: '/wiki/images/Anticlockwise_heliotrope%27s.jpg',
typeOfUrl: 'Unhashed local file',