Template:ExternalLinkToText: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(Created page with "* {{#pos:[https://github.com/mozilla/balrog-ui https://github.com/mozilla/balrog-ui]|[}} * {{#pos:[https://github.com/mozilla/balrog-ui https://github.com/mozilla/balrog-ui]|]...")
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
* {{#pos:[https://github.com/mozilla/balrog-ui https://github.com/mozilla/balrog-ui]|[}}
* {{#pos:[https://github.com/mozilla/balrog-ui https://github.com/mozilla/balrog-ui]|]}}
* {{#len:[https://github.com/mozilla/balrog-ui https://github.com/mozilla/balrog-ui]|]}}
* {{#expr: {{#len:[https://github.com/mozilla/balrog-ui https://github.com/mozilla/balrog-ui]}}-1}}
{{#ifeq: {{#pos:[https://github.com/mozilla/balrog-ui https://github.com/mozilla/balrog-ui]|[}}|0|True|False}}
{{#ifeq: {{#pos:[https://github.com/mozilla/balrog-ui https://github.com/mozilla/balrog-ui]|]}}|{{#expr: {{#len:[https://github.com/mozilla/balrog-ui https://github.com/mozilla/balrog-ui]}}-1}}|True|False}}
[https://github.com/mozilla/balrog-ui https://github.com/mozilla/balrog-ui---foo]
https://github.com/mozilla/balrog-ui https://github.com/mozilla/balrog-ui---foo]
<!--First Check if first char is a link char
<!--First Check if first char is a link char
-->{{#ifeq: {{#pos:[https://github.com/mozilla/balrog-ui https://github.com/mozilla/balrog-ui]|[}}|0|<!--
-->{{#ifeq: {{#pos:{{{1}}}|[}}|0|<!--
-Then Check if the last char is a link char-
-Then Check if the last char is a link char-
-->{{#ifeq: {{#pos:[https://github.com/mozilla/balrog-ui https://github.com/mozilla/balrog-ui]|]}}|{{#expr: {{#len:[https://github.com/mozilla/balrog-ui https://github.com/mozilla/balrog-ui]}}-1}}|<!--
-->{{#ifeq: {{#pos:{{{1}}}|]}}|{{#expr: {{#len:{{{1}}}}}-1}}|<!--
-Yay We're a link-
-Yay We're a link-
-->True|False}}|False}}
-Now to do the actual trimming of the fat
-->{{#sub:{{{1}}}|1|{{#pos:{{{1}}}|<nowiki> </nowiki>}}}}|<!--
-In the "Not A Link" cases just return orig string-
-->{{{1}}}}}|{{{1}}}}}

Latest revision as of 07:05, 2 January 2015

{{{1}}}