Module:Addlink/doc: Difference between revisions

From The Sims Wiki, a collaborative database for The Sims series
Jump to navigation Jump to search
Content added Content deleted
(Created page with "This module sanitizies link input. It will add <code><nowiki>[[ ]]</nowiki></code> around text given to it, but will ignore it if it sees that square brackets a...")
 
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 2:
 
==Examples==
:<code><nowiki>{{#invoke:InfoboxLinkAddlink|wrapInLink|[[Foo]]}}</nowiki></code>
 
:<code><nowiki>{{#invoke:InfoboxLinkAddlink|wrapInLink|Foo}}</nowiki></code>
 
Both produce the following output:
 
:{{#invoke:InfoboxLinkAddlink|wrapInLink|Foo}}
 
Piped links also work.
 
:<code><nowiki>{{#invoke:InfoboxLinkAddlink|wrapInLink|[[Foo|Bar]]}}</nowiki></code>
 
:<code><nowiki>{{#invoke:InfoboxLinkAddlink|wrapInLink|Foo{{!}}Bar}}</nowiki></code>
 
Both produce:
 
:{{#invoke:InfoboxLinkAddlink|wrapInLink|[[Foo|Bar]]}}
 
<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:

Foo

Piped links also work.

{{#invoke:Addlink|wrapInLink|[[Foo|Bar]]}}
{{#invoke:Addlink|wrapInLink|Foo{{!}}Bar}}

Both produce:

Bar