+ /**
+ * @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";
+ }
+