Template:Sandbox/Aurelain/Link/clean: Difference between revisions
From Heroes of Might and Magic: Olden Era Official Wiki
Created page with "<includeonly><!-- -->{{#if:{{{link|}}}<!-- -->|<!-- Perform consecutive replacements: -->{{#replace:<!-- -->{{#replace:<!-- -->{{#replace:{{{link}}}|Basic |}}<!-- -->|Advanced |}}<!-- -->|Expert |}}<!-- This is the language suffix: -->{{#ifeq:{{{lang|en}}}|en||/{{{lang}}}}}<!-- -->|<!-- -->}}<!-- --></includeonly><!-- #################################################################### --><no..." |
No edit summary |
||
| Line 1: | Line 1: | ||
<includeonly><!-- | <includeonly><!-- | ||
-->{{#if:{{{ | -->{{#if:{{{1|}}}<!-- | ||
-->|<!-- Perform consecutive replacements: | -->|<!-- Perform consecutive replacements: | ||
-->{{#replace:<!-- | -->{{#replace:<!-- | ||
-->{{#replace:<!-- | -->{{#replace:<!-- | ||
-->{{#replace:{{{ | -->{{#replace:{{{1}}}|Basic |}}<!-- | ||
-->|Advanced |}}<!-- | -->|Advanced |}}<!-- | ||
-->|Expert |}}<!-- | -->|Expert |}}<!-- | ||
This is the language suffix: | This is the language suffix: | ||
-->{{#ifeq:{{{ | -->{{#ifeq:{{{2|en}}}|en||/{{{2}}}}}<!-- | ||
-->|<!-- | -->|<!-- | ||
-->}}<!-- | -->}}<!-- | ||
| Line 15: | Line 15: | ||
--><noinclude> | --><noinclude> | ||
Removes the words <code>Basic</code>, <code>Advanced</code> and <code>Expert</code> from a | Removes the words <code>Basic</code>, <code>Advanced</code> and <code>Expert</code> from a text so it points to the "family" page. After that, it localizes the link. | ||
==1. Normal text== | ==1. Normal text== | ||
{{Color|yellow|Input:}} <code><nowiki>{{Sandbox/Aurelain/Link/clean| | {{Color|yellow|Input:}} <code><nowiki>{{Sandbox/Aurelain/Link/clean|Lorem Ipsum}}</nowiki></code> | ||
{{Color|lime|Output:}} {{Sandbox/Aurelain/Link/clean| | {{Color|lime|Output:}} {{Sandbox/Aurelain/Link/clean|Lorem Ipsum}} | ||
| Line 32: | Line 32: | ||
==3. Empty text== | ==3. With language code== | ||
{{Color|yellow|Input:}} <code><nowiki>{{Sandbox/Aurelain/Link/clean|Expert Foo|ja}}</nowiki></code> | |||
{{Color|lime|Output:}} {{Sandbox/Aurelain/Link/clean|Expert Foo|ja}} | |||
==4. Empty text== | |||
{{Color|yellow|Input:}} <code><nowiki>{{Sandbox/Aurelain/Link/clean}}</nowiki></code> | {{Color|yellow|Input:}} <code><nowiki>{{Sandbox/Aurelain/Link/clean}}</nowiki></code> | ||
Revision as of 07:55, 7 August 2026
Removes the words Basic, Advanced and Expert from a text so it points to the "family" page. After that, it localizes the link.
1. Normal text
Input: {{Sandbox/Aurelain/Link/clean|Lorem Ipsum}}
Output: Lorem Ipsum
2. Cleaned text
Input: {{Sandbox/Aurelain/Link/clean|Expert Foo}}
Output: Foo
3. With language code
Input: {{Sandbox/Aurelain/Link/clean|Expert Foo|ja}}
Output: Foo/ja
4. Empty text
Input: {{Sandbox/Aurelain/Link/clean}}
Output:


