Документация
|
Этот шаблон реализован на основе Lua с использованием функции delink() из модуля Delink. |
|
Этот шаблон содержит незавершённый перевод с английского языка. Вы можете помочь проекту, закончив перевод.
|
|
This template removes links from wikitext. It de-links wikilinks, URL links, removes HTML comments, and normalises whitespace. It handles most wikitext correctly, including category links, the colon trick, the pipe trick (normal and reverse), nested wikilinks, and invalid link characters.
Usage
- Basic
{{delink|text}}
- All parameters
{{delink
| 1 =
| wikilinks = no
| urls = no
| comments = no
| whitespace = no
| refs = yes
}}
Parameters
-
1
- the text to be de-linked.
-
wikilinks
- if set to "no", "n", "false", or "0", wikilinks are not de-linked.
-
urls
- if set to "no", "n", "false", or "0", URL links are not de-linked.
-
comments
- if set to "no", "n", "false", or "0", HTML comments are not removed.
-
whitespace
- if set to "no", "n", "false", or "0", whitespace is not normalised. The normalisation makes the whitespace of the resulting text look as if it had been put through the MediaWiki parser. For example, single new lines are converted to a single space, but double new lines are left alone.
-
refs
- (experimental) if set to "yes", "y", "true", or "1", removes references. This is not recommended, as only the [1], [2], etc. markers will be removed - the references themselves will still appear at the end of the page. There is no known workaround for this problem as of April 2014.
Examples
Code
|
Output
|
{{delink|[[Foo]]}}
|
Foo
|
{{delink|[[Foo]], [[bar]] and [[baz]].}}
|
Foo, bar and baz.
|
{{delink|I visited [www.example.com example.com].}}
|
I visited example.com.
|
See also
Шаблоны обработки строк (String-handling templates) |
---|
|
|
---|
|
By counting |
{{str mid|строка|N|L}} | Возвращает подстроку длиной L, начиная с позиции N.
{{str mid|строка|3|2}} → ро
| {{trunc|строка|N}} | Возвращает заданное количество символов с начала строки. {{trunc|строка|3}} → стр
| {{str left|строка|N}} | Возвращает заданное количество символов с начала строки. {{str left|строка|3}} → стр
| {{str crop|строка|N}} | Удаляет справа из строки заданное количество символов. {{str crop|строка|1}} → строк
| {{chop head and tail|строка|N}} | Удаляет с обеих сторон указанное число символов. {{chop head and tail|строка|2}} → ро
| {{str right|строка|N}} | Возвращает символы начиная с N и до конца строки. {{str right|строка|2}} → рока
| {{str rightc|строка|N}} | Возвращает правую часть строки из заданного количества символов. Результат как в {{str rightmost}}.
| {{str rightmost|строка|N}} | {{str rightmost|строка|3}} → ока
| {{str sub old|строка|N|L}} | Удаляет слева N символов и оставляет L.
{{str sub old|строка|2|3}} → рок
| {{str sub new|строка|N|L}} | Выборает подстроку из строки на основе выбранных индексов.
{{str sub new|строка|3|5}} → рок
| {{str index|строка|N}} | Возвращает из строки один символ под заданным номером N. {{str index|строка|4}} → о
|
|
---|
| By checking | |
---|
| Dedicated |
{{delink}} | Removes wikilink brackets (wikicode).
| {{remove file prefix}} | Removes "File:" (or "Image:") from filenames.
| {{PAGENAMEBASE}} | To trim off any parenthesis text at the end of a string (disambiguation).
| {{title disambig text}} | Returns text in parenthesis at the end of a string (disambiguation).
| {{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}} | Repeat character string a specified number of times.
| {{repeat}} | Repeat a string a specified number of times.
| {{replace}} | Returns the string, after replacing all occurrences of a specified string with another string.
| {{str rep}} | Returns the string, after replacing the first occurrence of a specified string with another string.
| {{str len|строка}} | Возвращает длину строки. {{Str len|строка}} → 6
| {{iflenge}} | [if len]gth [g]reater than or [e]qual to.
| {{str ≥ len}} | To check if a string is "longer or equally long" or "shorter" than a given length.
| {{str ≤ len}} | To check if a string is "shorter or equally long" or "longer" than a given length.
| {{str ≠ len}} | To check if a string is "not equal" or "equal" to a given length.
| {{str ≤ ≥ len}} | To check if a string is "shorter", "equal", or "longer" than a given length.
|
|
| |
Analysis and technical |
---|
|
{{str endswith}} | To check if a string ends with a given string.
| {{str find}} {{strfind short}}
| Позиция первого вхождения подстроки в текст.
| {{str find0}} | Zero-based substring search.
| {{str sub find}} | Searches a substring in a string at the given offset.
| {{str letter}} | Returns the number of letters that begin a string.
| {{str number}} | Returns the number of numbers that begin a string.
| {{str gtr str}} | Compares two strings for alphabetical order, and returns a value accordingly.
| {{ASCII code}} | Returns the ASCII value of a single character.
| {{a or an}} | Takes a noun and produces the appropriate indefinite article, based on whether the first letter is a vowel.
| |
| Module:String |
| ...Magic words
| About {{padleft:|}} .
| ...ParserFunctions
| About {{#titleparts:|}}, {{#expr:|}}, {{#ifeq:|}}, etc.
|
|
| | |
|
Во избежание поломок страниц, использующих данный шаблон, желательно экспериментировать в своём личном пространстве.