Module:Addlink/doc: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
No edit summary |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
==Examples== |
==Examples== |
||
:<code><nowiki>{{#invoke: |
:<code><nowiki>{{#invoke:Addlink|wrapInLink|[[Foo]]}}</nowiki></code> |
||
:<code><nowiki>{{#invoke: |
:<code><nowiki>{{#invoke:Addlink|wrapInLink|Foo}}</nowiki></code> |
||
Both produce the following output: |
Both produce the following output: |
||
:{{#invoke: |
:{{#invoke:Addlink|wrapInLink|Foo}} |
||
Piped links also work. |
Piped links also work. |
||
:<code><nowiki>{{#invoke: |
:<code><nowiki>{{#invoke:Addlink|wrapInLink|[[Foo|Bar]]}}</nowiki></code> |
||
:<code><nowiki>{{#invoke: |
:<code><nowiki>{{#invoke:Addlink|wrapInLink|Foo{{!}}Bar}}</nowiki></code> |
||
Both produce: |
Both produce: |
||
:{{#invoke: |
:{{#invoke:Addlink|wrapInLink|[[Foo|Bar]]}} |
||
==Issues== |
|||
The module is best used in a template, as it will not work if there is whitespace in the parameters. |
|||
:<code><nowiki>{{#invoke:InfoboxLink|wrapInLink| [[Foo]] }}</nowiki></code> |
|||
Produces: |
|||
:{{#invoke:InfoboxLink|wrapInLink| [[Foo]] }} |
|||
<includeonly>[[Category:Modules for general use]]</includeonly><noinclude>[[Category:Module documentation]]</noinclude> |
<includeonly>[[Category:Modules for general use]]</includeonly><noinclude>[[Category:Module documentation]]</noinclude> |
Latest revision as of 19:59, 30 April 2019
This module sanitizies link input. It will add [[ ]]
around text given to it, but will ignore it if it sees that square brackets are already present.
Examples
{{#invoke:Addlink|wrapInLink|[[Foo]]}}
{{#invoke:Addlink|wrapInLink|Foo}}
Both produce the following output:
Piped links also work.
{{#invoke:Addlink|wrapInLink|[[Foo|Bar]]}}
{{#invoke:Addlink|wrapInLink|Foo{{!}}Bar}}
Both produce: