mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-11-16 20:35:09 +00:00
Do not treat category captions as gallery captions
Categories are implemented via galleries, so they have the same markup, but while galleries have human-written captions, category captions just contain the file page. Change-Id: I6a8548fe696418befc789e20b114778fc724c314
This commit is contained in:
parent
8dc5f0c1c5
commit
28a7c1b8a4
|
@ -201,7 +201,14 @@
|
|||
$thumbCaption = $thumbContain.find( '.thumbcaption' ).clone();
|
||||
$thumbCaption.find( '.magnify' ).remove();
|
||||
if ( !$thumbCaption.length ) { // gallery, maybe
|
||||
$thumbCaption = $thumbContain.closest( '.gallerybox' ).find( '.gallerytext' ).clone();
|
||||
$thumbCaption = $thumbContain
|
||||
.closest( '.gallerybox' )
|
||||
.not( function () {
|
||||
// do not treat categories as galleries - the autogenerated caption they have is not helpful
|
||||
return $thumbContain.closest( '#mw-category-media' ).length;
|
||||
} )
|
||||
.find( '.gallerytext' )
|
||||
.clone();
|
||||
}
|
||||
caption = this.htmlUtils.htmlToTextWithLinks( $thumbCaption.html() || '' );
|
||||
|
||||
|
|
Loading…
Reference in a new issue