Permanently protected template

Difference between revisions of "Template:Autolink"

From Yugipedia
Jump to: navigation, search
(update array name to be template-specific and reduce chance of collisions)
(support Template:Nolink)
Line 1: Line 1:
{{ #arraydefine: @template:autolink-links | {{{1<noinclude>|{{int:Mainpage}}</noinclude>}}} | * | unique }}{{ #arrayprint: @template:autolink-links || $x$ | {{ #if: {{ #pos: {{{1}}} | * }} | <nowiki/>
+
{{ #ifeq: {{ #pos: {{{1}}} | &zwnj; }} | 0
 +
  | {{{1}}}
 +
  | {{ #arraydefine: @template:autolink-links | {{{1<noinclude>|{{int:Mainpage}}</noinclude>}}} | * | unique }}{{ #arrayprint: @template:autolink-links || $x$ | {{ #if: {{ #pos: {{{1}}} | * }} | <nowiki/>
 
* }}{{
 
* }}{{
  #if: {{ #pos: $x$ | {{!((}} }}
+
    #if: {{ #pos: $x$ | {{!((}} }}
  | $x$
+
    | $x$
  | [[:{{ #replace: {{ #replace: {{ #replace: $x$ | ''' }} | '' }} | "" }}|{{ #if: {{{2|}}} | {{{2}}} | {{ #replace: $x$ | "" | " }} }}]]
+
    | {{ #ifeq: {{ #pos: $x$ | &zwnj; }} | {{ #expr: {{ #len: $x$ }} - 6 }}
}} }}<noinclude>{{Documentation}}</noinclude>
+
      | $x$
 +
      | [[:{{ #replace: {{ #replace: {{ #replace: $x$ | ''' }} | '' }} | "" }}|{{ #if: {{{2|}}} | {{{2}}} | {{ #replace: $x$ | "" | " }} }}]]
 +
    }}
 +
  }} }}
 +
}}<noinclude>{{Documentation}}</noinclude>

Revision as of 04:24, 3 December 2014

Yugipedia