Widget:Wikipedia image
From CruisersWiki
(Difference between revisions)
(escape) |
|||
(7 intermediate revisions not shown) | |||
Line 5: | Line 5: | ||
}--><!--{ | }--><!--{ | ||
assign var="width" value=$width|regex_replace:'/^([0-9]*).*$/':'\1' | assign var="width" value=$width|regex_replace:'/^([0-9]*).*$/':'\1' | ||
+ | }--><!--{ | ||
+ | assign var="height" value=$height|regex_replace:'/^([0-9]*).*$/':'\1' | ||
+ | }--><!--{ | ||
+ | assign var="noSvg" value=$file|regex_replace:'/\.svg$/':'' | ||
}--><!--{ | }--><!--{ | ||
if !$nolink | if !$nolink | ||
}--><a href="<!--{$link}-->" class="image"><!--{ | }--><a href="<!--{$link}-->" class="image"><!--{ | ||
/if | /if | ||
- | }--><img <!--{if $thumb}-->class="thumbimage" <!--{/if}-->alt="<!--{$file}-->" src="https://en.wikipedia.org/wiki/Special:Redirect/file/<!--{$fileEscaped}--><!--{if $width}-->" width="<!--{$width}--><!--{/if}-->"><!--{ | + | }--><img <!--{if $thumb}-->class="thumbimage" <!--{/if}-->alt="<!--{$file|escape}-->" src="https://en.wikipedia.org/wiki/Special:Redirect/file/<!--{$fileEscaped}--><!--{ |
+ | if $file == $noSvg | ||
+ | }-->?dummy<!--{if $width}-->&width=<!--{$width}--><!--{/if}--><!--{if $height}-->&height=<!--{$height}--><!--{/if}--><!--{ | ||
+ | /if | ||
+ | }-->"<!--{if $width}--> width="<!--{$width}-->"<!--{/if}--><!--{if $height}--> height="<!--{$height}-->"<!--{/if}-->><!--{ | ||
if !$nolink | if !$nolink | ||
}--></a><!--{ | }--></a><!--{ | ||
/if | /if | ||
}--></includeonly><noinclude> | }--></includeonly><noinclude> | ||
+ | |||
A helper widget for [[Template:Wikipedia image]] | A helper widget for [[Template:Wikipedia image]] | ||
- | + | <!-- https://doc.wikimedia.org/mediawiki-core/master/php/SpecialRedirect_8php_source.html --> | |
</noinclude> | </noinclude> |
Latest revision as of 13:39, 3 March 2019
A helper widget for Template:Wikipedia image