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
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<includeonly><!--
<includeonly><!--
-->{{#if:{{{link|}}}<!--
-->{{#if:{{{1|}}}<!--
     -->|<!-- Perform consecutive replacements:
     -->|<!-- Perform consecutive replacements:
         -->{{#replace:<!--
         -->{{#replace:<!--
             -->{{#replace:<!--
             -->{{#replace:<!--
                 -->{{#replace:{{{link}}}|Basic |}}<!--
                 -->{{#replace:<!--
             -->|Advanced |}}<!--
                    -->{{#replace:{{{1}}}|Basic |}}<!--
         -->|Expert |}}<!--
                -->|Advanced |}}<!--
             -->|Expert |}}<!--
         -->|Masterful |}}<!--
         This is the language suffix:
         This is the language suffix:
         -->{{#ifeq:{{{lang|en}}}|en||/{{{lang}}}}}<!--
         -->{{#ifeq:{{{2|en}}}|en||/{{{2}}}}}<!--
     -->|<!--
     -->|<!--
-->}}<!--
-->}}<!--
Line 15: Line 17:
--><noinclude>
--><noinclude>


Removes the words <code>Basic</code>, <code>Advanced</code> and <code>Expert</code> from a link so it points to the "family" page. After that, it localizes the link.
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|link=Lorem Ipsum}}</nowiki></code>
{{Color|yellow|Input:}} <code><nowiki>{{Sandbox/Aurelain/Link/clean|Lorem Ipsum}}</nowiki></code>


{{Color|lime|Output:}} {{Sandbox/Aurelain/Link/clean|link=Lorem Ipsum}}
{{Color|lime|Output:}} {{Sandbox/Aurelain/Link/clean|Lorem Ipsum}}




Line 32: Line 34:




==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>

Latest revision as of 19:09, 25 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: