用法
- 基本
模板链接:{{除鏈|文本}}
- 所有参数
{{除链
|1=
|wikilinks = no
|urls = no
|comments = no
|whitespace = no
|refs = yes
}}
参数
1
:要除链的文字
wikilinks
:设为no、n、false或0时,维基连结不会被除去
urls
:设为no、n、false或0时,网址链不会被除去
comments
:设为no、n、false或0时,HTML注解不会被去除
whitespace
:设为no、n、false或0时,空格不会被正常化。空格正常化会使结果文本看起来经过MediaWiki的语法分析器,例如空数格和换行皆显示为一个空格,而空行则不转换。
refs
:(测试中)设为yes、y、true或1时去除引注连结。不建议使用,因只会去除[1][2]等标记,引注文字仍会出现在页底。
范例
原文
|
代码
|
显示
|
求闻百科
|
{{除鏈|[[求聞百科]]}}
|
求闻百科
|
香蕉、苹果和凤梨
|
{{除鏈|[[香蕉]]、[[蘋果]]和[[鳳梨]]}}
|
香蕉、苹果和凤梨
|
动物界、植物界
|
{{除鏈|[[动物|动物界]]、[[植物界]]}}
|
动物界、植物界
|
我常造访求闻百科
|
{{除鏈|我常造訪[https://www.qiuwen.wiki/wiki/Qiuwen:首页 求聞百科]}}
|
我常造访求闻百科
|
我常造访[1]
|
{{除鏈|我常造訪[https://www.qiuwen.wiki/wiki/Qiuwen:首页]}}
|
我常造访
|
这是File:Example-zh.jpg:
|
{{除鏈|這是[[:File:Example-zh.jpg]]:<br/>[[File:Example-zh.jpg]]}}
|
这是File:Example-zh.jpg:
|
参见
根据数量处理
| 模板链接:{{str right}} | 返回从左向右移除若干个字符后的字符串 | 模板链接:{{str rightc}} | 返回从后向前指定数量的字符串,如果字符串为空则返回一个参数 | 模板链接:{{str rightmost}} | To trim down to the last specified number of characters. | 模板链接:{{str sub old}} | To trim down to a specified number, starting at a given number from the left. | 模板链接:{{str sub new}} | Select a substr based on starting and ending index. | 模板链接:{{str index}} | 返回字符串的第×个字符 |
|
根据条件处理
专用于Wiki语法
| 模板链接:{{WikiProjectbasename}} | Removes "WikiProject" from a pagename. | 模板链接:{{remove unranked}} | Removes the string "unranked_" from the left of a string (taxonomy). | 模板链接:{{ship prefix}} | Returns the length of a ship's name prefix, if listed (ship names). | 模板链接:{{title year}} | Returns the 4-digit year from a pagename, if any. |
|
插入、替换、长度
模板链接:{{strloc insert}} | Inserts a string at character location strloc, or appends if strloc<=0. | 模板链接:{{loop}} | 特定次数重复字串。 | 模板链接:{{replace}} | 在字串中查找并全部替换某字串后返回。 | 模板链接:{{str rep}} | 在字串中查找并替换首次出现的某字串后返回。 | 模板链接:{{digits}} | 移除字串中不是数字(0~9)的字元。 |
|
模板链接:{{str len}} | 返回字串长度。 | 模板链接:{{str ≥ len}} | 检查一个字串和某一给定长度相比是“更长或等长”还是“更短”。 | 模板链接:{{str ≤ len}} | 检查一个字串和某一给定长度相比是“更短或等长”还是“更长”。 | 模板链接:{{str ≠ len}} | 检查一个字串和某一给定长度相比是“不等长”还是“等长”。 | 模板链接:{{str ≤ ≥ len}} | 检查一个字串和某一给定长度相比是“更短”、“等长”还是“更长”。 |
|
分析、技术