微件:ImgTag:修订间差异
跳转到导航
跳转到搜索
无编辑摘要 |
无编辑摘要 |
||
| (未显示同一用户的15个中间版本) | |||
| 第1行: | 第1行: | ||
<noinclude> | |||
这个微件是<nowiki><img></nowiki>的微件实现,用来1.42版本之后MW不再支持wikitext内使用<nowiki><img></nowiki>,兼容百科上现存的外链图片。除非有很好的理由并经过管理确认,不应该使用这个微件引用任何新图片,而是应该把图片上传到百科然后使用wikitext引用图片。 | |||
使用: | |||
<code><nowiki> | |||
{{#widget:ImgTag|src=链接|width=宽度(默认auto)|height=高度(默认auto)}} | |||
</nowiki></code> | |||
所有可用参数: | |||
* src | |||
* alt | |||
* width | |||
* height | |||
* style | |||
* class | |||
* loading | |||
* decoding | |||
* fetchpriority | |||
* sizes | |||
* srcset | |||
* crossorigin | |||
* referrerpolicy | |||
</noinclude> | |||
<includeonly> | <includeonly> | ||
<img | <img | ||
<!--{* Required attribute *}--> | <!--{* Required attribute *}--> | ||
<!--{if $src}-->src="<!--{$src}-->"<!--{/if}--> | <!--{if !empty($src)}-->src="<!--{$src|escape:'html'}-->"<!--{/if}--> | ||
<!--{* Core attributes *}--> | <!--{* Core attributes *}--> | ||
<!--{if $alt}-->alt="<!--{$alt}-->"<!--{/if}--> | <!--{if !empty($alt)}-->alt="<!--{$alt|escape:'html'}-->"<!--{/if}--> | ||
<!--{if $width}-->width="<!--{$width}-->"<!--{/if}--> | <!--{if !empty($width)}-->width="<!--{$width|escape:'html'}-->"<!--{/if}--> | ||
<!--{if $height}-->height="<!--{$height}-->"<!--{/if}--> | <!--{if !empty($height)}-->height="<!--{$height|escape:'html'}-->"<!--{/if}--> | ||
<!--{if !empty($style)}-->style="<!--{$style|escape:'html'}-->"<!--{/if}--> | |||
<!--{if !empty($class)}-->class="<!--{$class|escape:'html'}-->"<!--{/if}--> | |||
<!--{* Loading behavior *}--> | <!--{* Loading behavior *}--> | ||
<!--{if $loading}-->loading="<!--{$loading}-->"<!--{/if}--> | <!--{if !empty($loading)}-->loading="<!--{$loading|escape:'html'}-->"<!--{/if}--> | ||
<!--{if $decoding}-->decoding="<!--{$decoding}-->"<!--{/if}--> | <!--{if !empty($decoding)}-->decoding="<!--{$decoding|escape:'html'}-->"<!--{/if}--> | ||
<!--{if $fetchpriority}-->fetchpriority="<!--{$fetchpriority}-->"<!--{/if}--> | <!--{if !empty($fetchpriority)}-->fetchpriority="<!--{$fetchpriority|escape:'html'}-->"<!--{/if}--> | ||
<!--{* Responsive image attributes *}--> | <!--{* Responsive image attributes *}--> | ||
<!--{if $sizes}-->sizes="<!--{$sizes}-->"<!--{/if}--> | <!--{if !empty($sizes)}-->sizes="<!--{$sizes|escape:'html'}-->"<!--{/if}--> | ||
<!--{if $srcset}-->srcset="<!--{$srcset}-->"<!--{/if}--> | <!--{if !empty($srcset)}-->srcset="<!--{$srcset|escape:'html'}-->"<!--{/if}--> | ||
<!--{* Security and privacy *}--> | <!--{* Security and privacy *}--> | ||
<!--{if $crossorigin}-->crossorigin="<!--{$crossorigin}-->"<!--{/if}--> | <!--{if !empty($crossorigin)}-->crossorigin="<!--{$crossorigin|escape:'html'}-->"<!--{/if}--> | ||
<!--{if $referrerpolicy}-->referrerpolicy="<!--{$referrerpolicy | <!--{if !empty($referrerpolicy)}-->referrerpolicy="<!--{$referrerpolicy|escape:'html'}-->"<!--{/if}--> | ||
/> | /> | ||
</includeonly> | </includeonly> | ||
2024年12月30日 (一) 23:39的最新版本
这个微件是<img>的微件实现,用来1.42版本之后MW不再支持wikitext内使用<img>,兼容百科上现存的外链图片。除非有很好的理由并经过管理确认,不应该使用这个微件引用任何新图片,而是应该把图片上传到百科然后使用wikitext引用图片。
使用:
{{#widget:ImgTag|src=链接|width=宽度(默认auto)|height=高度(默认auto)}}
所有可用参数:
- src
- alt
- width
- height
- style
- class
- loading
- decoding
- fetchpriority
- sizes
- srcset
- crossorigin
- referrerpolicy