Merge "Make embed text short URL into a link in HTML mode"

This commit is contained in:
jenkins-bot 2016-08-11 19:19:19 +00:00 committed by Gerrit Code Review
commit 0716876c6d
2 changed files with 5 additions and 4 deletions

View file

@ -163,11 +163,12 @@
EFFP.getCreditHtml = function ( info ) {
var creditText, creditParams,
shortURL = info.imageInfo.descriptionShortUrl,
shortLink = this.htmlUtils.makeLinkText( shortURL, { href: shortURL } ),
license = info.imageInfo.license,
byline = this.getByline( info.imageInfo.author, info.imageInfo.source, info.imageInfo.attribution );
if ( !byline && !license ) {
return shortURL;
return shortLink;
}
creditParams = [
@ -183,7 +184,7 @@
creditParams.push( license.getShortLink() );
}
creditParams.push( shortURL );
creditParams.push( shortLink );
creditText = mw.message.apply( mw, creditParams ).plain();
return creditText;

View file

@ -265,7 +265,7 @@
}
} );
assert.strictEqual( html, 'By Author - Source, link', 'Sanity check' );
assert.strictEqual( html, 'By Author - Source, <a href="link">link</a>', 'Sanity check' );
html = formatter.getCreditHtml( {
repoInfo: {
@ -288,6 +288,6 @@
}
} );
assert.strictEqual( html, 'By Author - Source, <a href="http://www.wtfpl.net/">WTFPL v2</a>, link', 'Sanity check' );
assert.strictEqual( html, 'By Author - Source, <a href="http://www.wtfpl.net/">WTFPL v2</a>, <a href="link">link</a>', 'Sanity check' );
} );
}( mediaWiki ) );