}
$textlink = $this->mShowFilename ?
- // Preloaded into LinkCache above
- Linker::linkKnown(
- $nt,
- htmlspecialchars(
- is_int( $this->getCaptionLength() ) ?
- $lang->truncate( $nt->getText(), $this->getCaptionLength() ) :
- $nt->getText()
- ),
- [
- 'class' => 'galleryfilename' .
- ( $this->getCaptionLength() === true ? ' galleryfilename-truncate' : '' )
- ]
- ) . "\n" :
+ $this->getCaptionHtml( $nt, $lang ) :
'';
$galleryText = $textlink . $text . $meta;
return $output;
}
+ /**
+ * @param Title $nt
+ * @param Language $lang
+ * @return string HTML
+ */
+ protected function getCaptionHtml( Title $nt, Language $lang ) {
+ // Preloaded into LinkCache in toHTML
+ return Linker::linkKnown(
+ $nt,
+ htmlspecialchars(
+ is_int( $this->getCaptionLength() ) ?
+ $lang->truncate( $nt->getText(), $this->getCaptionLength() ) :
+ $nt->getText()
+ ),
+ [
+ 'class' => 'galleryfilename' .
+ ( $this->getCaptionLength() === true ? ' galleryfilename-truncate' : '' )
+ ]
+ ) . "\n";
+ }
+
/**
* Add the wrapper html around the thumb's caption
*