hl – Template
Lou Montana (talk | contribs) (Fix (code refactor)) |
Lou Montana (talk | contribs) (Add semicolon escape) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
| <var>{{#switch:0 | | <var>{{#switch:0 | ||
| {{#pos:{{{c|{{{1}}}}}}|:}}= {{#replace:{{{c|{{{1}}}}}}|:|:}} | | {{#pos:{{{c|{{{1}}}}}}|:}}= {{#replace:{{{c|{{{1}}}}}}|:|:}} | ||
| {{#pos:{{{c|{{{1}}}}}}|;}}= {{#replace:{{{c|{{{1}}}}}}|;|;}} | |||
| {{#pos:{{{c|{{{1}}}}}}|#}}= {{#replace:{{{c|{{{1}}}}}}|#|#}} | | {{#pos:{{{c|{{{1}}}}}}|#}}= {{#replace:{{{c|{{{1}}}}}}|#|#}} | ||
| {{#ifexpr: {{#if:{{#pos:{{{c|{{{1}}}}}}|/}}|1|0}} and {{#if:{{#pos:{{{c|{{{1}}}}}}|[<nowiki/>[}}|0|1}}|0}}= | | {{#pos:{{{c|{{{1}}}}}}|*}}= {{#replace:{{{c|{{{1}}}}}}|*|*}} | ||
| {{#ifexpr: {{#if:{{#pos:{{{c|{{{1}}}}}}|/}}|1|0}} and {{#if:{{#pos:{{{c|{{{1}}}}}}|[<nowiki/>[}}|0|1}}|0}}= {{#replace:{{#replace:{{{c|{{{1}}}}}}|/|<wbr>/}}|<<wbr>/|</}} | |||
| {{#if:{{#pos:{{{c|{{{1}}}}}}|\}}|0}}= {{#replace:{{{c|{{{1}}}}}}|\|<wbr>\}} | | {{#if:{{#pos:{{{c|{{{1}}}}}}|\}}|0}}= {{#replace:{{{c|{{{1}}}}}}|\|<wbr>\}} | ||
| {{{c|{{{1}}}}}} | | {{{c|{{{1}}}}}} | ||
Line 30: | Line 32: | ||
|result4= {{hl|oneLongFilePath\ThatCannotLineBreak\OnMobileOrOtherNonWideScreen\BecauseThereAreNoSpaces\AndGivenFirefoxAndChromeBrowsersHaveADifferentBehaviour\LetsCoverAllTheCases}} | |result4= {{hl|oneLongFilePath\ThatCannotLineBreak\OnMobileOrOtherNonWideScreen\BecauseThereAreNoSpaces\AndGivenFirefoxAndChromeBrowsersHaveADifferentBehaviour\LetsCoverAllTheCases}} | ||
|example5= <nowiki>{{hl|#test1}} test2 {{hl|#test3}} test4</nowiki> | |example5= <nowiki/> | ||
|result5= {{hl|#test1}} test2 {{hl|#test3}} test4 | <nowiki>{{hl|#test1}} test2 {{hl|#test3}} test4</nowiki><br> | ||
<nowiki>{{hl|*test1}} test2 {{hl|*test3}} test4</nowiki><br> | |||
<nowiki>{{hl|:test1}} test2 {{hl|:test3}} test4</nowiki><br> | |||
<nowiki>{{hl| test1}} test2 {{hl| test3}} test4</nowiki> | |||
|result5= <nowiki/> | |||
{{hl|#test1}} test2 {{hl|#test3}} test4<br> | |||
{{hl|*test1}} test2 {{hl|*test3}} test4<br> | |||
{{hl|:test1}} test2 {{hl|:test3}} test4<br> | |||
{{hl| test1}} test2 {{hl| test3}} test4 | |||
|example6= <nowiki>{{hl|:}}</nowiki><br><nowiki>a {{hl|:}} b</nowiki><br><nowiki>; test {{hl|test}}</nowiki><br><nowiki>; test {{hl|:test}}</nowiki><br><nowiki>; test: {{hl|test}}</nowiki> | |example6= <nowiki/> | ||
| | <nowiki>* {{hl|;}}</nowiki><br> | ||
<nowiki>* a {{hl|;}} b</nowiki><br> | |||
<nowiki>* {{hl|:}}</nowiki><br> | |||
<nowiki>* a {{hl|:}} b</nowiki><br> | |||
<nowiki>; test {{hl|test}}</nowiki><br> | |||
<nowiki>; test {{hl|:test}}</nowiki><br> | |||
<nowiki>; test: {{hl|test}}</nowiki><br> | |||
<nowiki>; {{hl|test}}: {{hl|test}}</nowiki><br> | |||
<nowiki>; {{hl|;test}}: {{hl|test}}</nowiki><br> | |||
<nowiki>; {{hl|:test}}: {{hl|test}}</nowiki><br> | |||
<nowiki>; {{hl|test}}: {{hl|;test}}</nowiki><br> | |||
<nowiki>; {{hl|test}}: {{hl|:test}}</nowiki><br> | |||
<nowiki>; {{hl|;test}}: {{hl|:test}}</nowiki> | |||
|result6= <nowiki/> | |||
* {{hl|;}} | |||
* a {{hl|;}} b | |||
* {{hl|:}} | |||
* a {{hl|:}} b | |||
; test {{hl|test}} | ; test {{hl|test}} | ||
; test {{hl|:test}} | ; test {{hl|:test}} | ||
; test :{{hl|test}} | ; test :{{hl|test}} | ||
; {{hl|test}}: {{hl|test}} | |||
; {{hl|;test}}: {{hl|test}} | |||
; {{hl|:test}}: {{hl|test}} | |||
; {{hl|test}}: {{hl|;test}} | |||
; {{hl|test}}: {{hl|:test}} | |||
; {{hl|;test}}: {{hl|:test}} | |||
|example7= <nowiki>* {{hl|:}}</nowiki><br><nowiki>* {{hl|: test}}</nowiki><br><nowiki>* {{hl|[[Template:Link]]}}</nowiki><br><nowiki>* {{hl|[[Template:Link/Internal]]}}</nowiki><br><nowiki>* {{hl|[[Description.ext#CfgSounds]]}}</nowiki><br><nowiki>* {{hl|{{Link|Description.ext#CfgSounds}}}}</nowiki><br><nowiki>* {{hl|{{GVI|arma3|1.00}}}}</nowiki><br><nowiki>* {{hl|<nowiki>{{GVI|arma3|1.00}}</nowiki>}}</nowiki><br><nowiki>* {{hl|c= <nowiki>{{GVI|arma3|1.00}}</nowiki>}}</nowiki> | |example7= <nowiki/> | ||
<nowiki>* {{hl|;}}</nowiki><br> | |||
<nowiki>* {{hl|; test}}</nowiki><br> | |||
<nowiki>* {{hl|:}}</nowiki><br> | |||
<nowiki>* {{hl|: test}}</nowiki><br> | |||
<nowiki>* ''{{hl|test}}''</nowiki><br> | |||
<nowiki>* '''{{hl|test}}'''</nowiki><br> | |||
<nowiki>* {{hl|[[Template:Link]]}}</nowiki><br> | |||
<nowiki>* {{hl|[[Template:Link/Internal]]}}</nowiki><br> | |||
<nowiki>* {{hl|[[Description.ext#CfgSounds]]}}</nowiki><br> | |||
<nowiki>* {{hl|{{Link|Description.ext#CfgSounds}}}}</nowiki><br> | |||
<nowiki>* {{hl|{{GVI|arma3|1.00}}}}</nowiki><br> | |||
<nowiki>* {{hl|<nowiki>{{GVI|arma3|1.00}}</nowiki>}}</nowiki><br> | |||
<nowiki>* {{hl|c= <nowiki>{{GVI|arma3|1.00}}</nowiki>}}</nowiki><br> | |||
<nowiki>* {{hl|2&nbsp;km<sup>2</sup>}}</nowiki><br> | |||
|result7= <nowiki/> | |result7= <nowiki/> | ||
* {{hl|;}} | |||
* {{hl|; test}} | |||
* {{hl|:}} | * {{hl|:}} | ||
* {{hl|: test}} | * {{hl|: test}} | ||
* ''{{hl|test}}'' | |||
* '''{{hl|test}}''' | |||
* {{hl|[[Template:Link]]}} | * {{hl|[[Template:Link]]}} | ||
* {{hl|[[Template:Link/Internal]]}} | * {{hl|[[Template:Link/Internal]]}} | ||
Line 50: | Line 101: | ||
* {{hl|<nowiki>{{GVI|arma3|1.00}}</nowiki>}} | * {{hl|<nowiki>{{GVI|arma3|1.00}}</nowiki>}} | ||
* {{hl|c= <nowiki>{{GVI|arma3|1.00}}</nowiki>}} | * {{hl|c= <nowiki>{{GVI|arma3|1.00}}</nowiki>}} | ||
* {{hl|2 km<sup>2</sup>}} | |||
}}</noinclude> | }}</noinclude> |
Latest revision as of 15:57, 14 February 2025
This template displays highlighted content - it replaces <tt> which was used across the wiki. It also adds the page to the hl template usage error category on usage error.
This template is used on these pages.
Usage
{{hl|c}}
- c: the content to display.
If it contains an equal sign =, which it should not (for inline code, <syntaxhighlight>/<sqf> should be used instead):- replace it with {{=}}
- use c=
- use the MediaWiki trick 1=
Code | Result |
---|---|
{{hl}} | -No content provided- |
{{hl|"AWARE"}} | "AWARE" |
{{hl|oneLongFilePath |
oneLongFilePath |
{{hl|oneLongFilePath |
oneLongFilePath |
{{hl|#test1}} test2 {{hl|#test3}} test4 |
#test1 test2 #test3 test4 |
* {{hl|;}} |
|
* {{hl|;}} |
|