Difference between revisions of "Stripref"
From Sega Retro
(→Usage) |
|||
Line 7: | Line 7: | ||
==Usage== | ==Usage== | ||
<pre>{{stripref|123{{ref|http://segaretro.org}}}}</pre> | <pre>{{stripref|123{{ref|http://segaretro.org}}}}</pre> | ||
+ | returns: | ||
+ | {{stripref|123{{ref|http://segaretro.org}}}} | ||
+ | |||
+ | |||
+ | <pre>{{stripref|123 456{{ref|http://segaretro.org}}}}</pre> | ||
returns: | returns: | ||
− | {{stripref|123{{ref|http://segaretro.org}}}} | + | {{stripref|123 456{{ref|http://segaretro.org}}}} |
+ | |||
+ | |||
+ | <pre>{{stripref|123{{magref|egm|1|1}}}}</pre> | ||
+ | returns: | ||
+ | |||
+ | {{stripref|123{{magref|egm|1|1}}}} | ||
+ | |||
+ | |||
+ | <pre>{{stripref|123 456{{magref|egm|1|1}}}}</pre> | ||
+ | returns: | ||
+ | |||
+ | {{stripref|123{{magref|egm|1|1}}}} | ||
+ | |||
+ | |||
+ | <pre>{{stripref|123{{fileref|bums.pdf|page=3}}}}</pre> | ||
+ | |||
+ | returns: | ||
+ | |||
+ | {{stripref|123{{fileref|bums.pdf|page=3}}}} | ||
+ | |||
+ | |||
+ | <pre>{{stripref|123 456{{fileref|bums.pdf|page=3}}}}</pre> | ||
+ | |||
+ | returns: | ||
+ | |||
+ | {{stripref|123 456{{fileref|bums.pdf|page=3}}}} | ||
+ | |||
+ | |||
+ | |||
+ | <pre>{{stripref|123{{intref|bums}}</pre> | ||
+ | |||
+ | returns: | ||
+ | |||
+ | {{stripref|123{{intref|bums}}}} | ||
+ | |||
+ | |||
+ | <pre>{{stripref|123 456{{intref|bums}}}}</pre> | ||
+ | |||
+ | returns: | ||
+ | {{stripref|123 456{{intref|bums}}}} | ||
''Warning:'' Don't repeatedly use for the same string, because each usage is listed in the references section. Instead, store the string to a variable and use that. | ''Warning:'' Don't repeatedly use for the same string, because each usage is listed in the references section. Instead, store the string to a variable and use that. | ||
[[Category:Sega Retro templates]]</noinclude> | [[Category:Sega Retro templates]]</noinclude> |
Revision as of 16:42, 21 November 2018
This template removes references from a string.
Usage
{{stripref|123{{ref|http://segaretro.org}}}}
returns:
123CategoryBadexternalreference
{{stripref|123 456{{ref|http://segaretro.org}}}}
returns:
123456CategoryBadexternalreference
{{stripref|123{{magref|egm|1|1}}}}
returns:
123
{{stripref|123 456{{magref|egm|1|1}}}}
returns:
123
{{stripref|123{{fileref|bums.pdf|page=3}}}}
returns:
123
{{stripref|123 456{{fileref|bums.pdf|page=3}}}}
returns:
123456
{{stripref|123{{intref|bums}}
returns:
123
{{stripref|123 456{{intref|bums}}}}
returns:
123456
Warning: Don't repeatedly use for the same string, because each usage is listed in the references section. Instead, store the string to a variable and use that.