Шаблон:Pre2
{{#switch:{{{2}}}|nowiki|nw={{{3}}}|{{{2}}}}}|white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word;">{{#switch:{{{1}}}|nowiki|nw={{{2}}}|{{{1}}}}} }}
{{#ifeq:pre2 |док
|
{{#ifeq:show |show
|| Ово је документациона подстраница за Шаблон:Pre2. Садржи информације о коришћењу, категоријама и другом садржају који није део оригиналне странице. |
}}{{#if: |
| {{#ifexist:Шаблон:Pre2
| [[Категорија:Документација {{#switch:Шаблон |Шаблон=шаблона |Модул=модула |Корисник=корисничких страница |#default=Википедије}}]]
|
}}
}}
|
}}
{{Pre2}} uses <pre> tags, but with text that is either wrapped or is contained in a horizontal scrollbox. This means the text will not stretch past the right side of the screen.
As it uses real <pre> tags (unlike {{pre}}), it will be displayed correctly regardless of how the user's Wikipedia skin renders <pre> boxes.
If you want to disable wikitext in it, you should use <nowiki> tags inside the template (see below).
Usage
Wrapped text
{{Pre2|Text to be displayed. And more and more and more... and a paragraph break.
And then more and more...}}
- produces:
{{#switch:{{{2}}}|nowiki|nw={{{3}}}|{{{2}}}}}|white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word;">{{#switch:Text to be displayed. And more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and a paragraph break.
And then more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more.|nowiki|nw={{{2}}}|Text to be displayed. And more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and a paragraph break.
And then more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more.}} }}
Scrollbox
{{Pre2|scroll|Text to be displayed. And more and more and more... and a paragraph break.
And then more and more...}}
- produces:
{{#switch:Text to be displayed. And more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and a paragraph break.
And then more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more.|nowiki|nw={{{3}}}|Text to be displayed. And more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and a paragraph break.
And then more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more.}}|white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word;">{{#switch:scroll|nowiki|nw=Text to be displayed. And more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and a paragraph break.
And then more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more.|scroll}} }}
Style
When the text contains links is better to change the text color, thus highlighting:
{{Pre2|style=color:green|Text to be [[Hyperlink|link]]. WARNING! A{{=}}B, you must use Template:=. And more and more and more... and a paragraph break.
And then more and more...}}
- produces:
{{#switch:{{{2}}}|nowiki|nw={{{3}}}|{{{2}}}}}|white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word;color:green">{{#switch:Text to be link. WARNING! A=B, you must use Template:=. And more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and a paragraph break.|nowiki|nw={{{2}}}|Text to be link. WARNING! A=B, you must use Template:=. And more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and a paragraph break.}} }}
Using wikitext
To disable wikitext (e.g. [[links]]), <nowiki> tags must be used in the form:
{{Pre2|<nowiki>Your [[text]]{{dn|name=Pre2}}, which ''might'' include {{tl|templates}}.<noinclude>[[Category:Examples]]</noinclude></nowiki>}}
This will produce this:
{{#switch:{{{2}}}|nowiki|nw={{{3}}}|{{{2}}}}}|white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word;">{{#switch:Your [[text]]{{dn|name=Pre2}}, which ''might'' include {{tl|templates}}.<noinclude>[[Category:Examples]]</noinclude>|nowiki|nw={{{2}}}|Your [[text]]{{dn|name=Pre2}}, which ''might'' include {{tl|templates}}.<noinclude>[[Category:Examples]]</noinclude>}} }}
as opposed to: <pre style="{{#ifeq:Your text{{#if:
|[[{{{1}}}|{{ #if: | | {{{1}}} }}]]
}}{{#switch:¬
|¬= |SUBST=
}}{{#if:|{{#ifeq:{{{name}}}|Pre2||{{#if:||}}}}}}{{#if:
|[{{#if:
|{{{pre-text}}}
}}[[Википедија:Чишћење|<span title="Википедија:Чишћење{{#if:| ({{#if:{{ safesubst:#if:1|}}|{{#switch:{{#if:{{ safesubst:#if:1|}} |{{#switch:{{ safesubst:#if:1|}} |january|jan|јануар|јан|januar=1 |february|feb|фебруар|фебуар|феб|фебр|februar=2 |march|mar|март|мар|mart=3 |apr|april|апр|април=4 |may|мај|maj=5 |june|jun|јуни|јун|juni=6 |july|jul|јули|јул|juli=7 |august|aug|август|аугуст|авг|ауг|avgust|avg=8 |september|sep|sept|септембар|сеп|септ|septembar=9 |october|oct|октобар|окт|oktobar|okt=10 |november|nov|новембар|нов|novembar=11 |december|dec|децембар|дец|decembar=12 |{{#ifexpr:{{ safesubst:#if:1|}}<0 |{{#ifexpr:(({{ safesubst:#if:1|}})round 0)!=({{ safesubst:#if:1|}}) |{{#expr:12-(((0.5-({{ safesubst:#if:1|}}))round 0)mod 12)}} |{{#expr:12-(((11.5-({{ safesubst:#if:1|}}))round 0)mod 12)}} }} |{{#expr:(((10.5+{{ safesubst:#if:1|}})round 0)mod 12)+1}} }} }} |{{ safesubst:#if: | {{ safesubst:#if: | {{ safesubst:#ifeq: | yes | [[ {{ safesubst:#if:1| }}|{{ safesubst:#if:1| }}]] | [[|{{ safesubst:#if:1| }}]] }} | {{ safesubst:#if:1| }} }} | {{ safesubst:#if: | {{ safesubst:#ifeq: | yes | [[ {{ safesubst:#if:1| Недостаје неопходни параметар 1, месец! }} |{{ safesubst:#if:1| Недостаје неопходни параметар 1, месец! }}]] | [[ {{ safesubst:#if:1| }} |{{ safesubst:#if:1| Недостаје неопходни параметар 1, месец! }}]] }} | {{ safesubst:#if:1| Недостаје неопходни параметар 1, месец! }} }} }} }}|1=јануар|2=фебруар|3=март|4=април|5=мај|6=јун|7=јул|8=август|9=септембар|10=октобар|11=новембар|12=децембар|{{ safesubst:#if: | {{ safesubst:#if: | {{ safesubst:#ifeq: | yes | [[ {{ safesubst:#if:1| }}|{{ safesubst:#if:1| }}]] | [[|{{ safesubst:#if:1| }}]] }} | {{ safesubst:#if:1| }} }} | {{ safesubst:#if: | {{ safesubst:#ifeq: | yes | [[ {{ safesubst:#if:1| Погрешан унос за неопходни параметар 1, месец! }} |{{ safesubst:#if:1| Погрешан унос за неопходни параметар 1, месец! }}]] | [[ {{ safesubst:#if:1| }} |{{ safesubst:#if:1| Погрешан унос за неопходни параметар 1, месец! }}]] }} | {{ safesubst:#if:1| Погрешан унос за неопходни параметар 1, месец! }} }} }}}}|{{ safesubst:#if: | {{ safesubst:#if: | {{ safesubst:#ifeq: | yes | [[ {{ safesubst:#if:1| }}|{{ safesubst:#if:1| }}]] | [[|{{ safesubst:#if:1| }}]] }} | {{ safesubst:#if:1| }} }} | {{ safesubst:#if: | {{ safesubst:#ifeq: | yes | [[ {{ safesubst:#if:1| Недостаје неопходни параметар 1, месец! }} |{{ safesubst:#if:1| Недостаје неопходни параметар 1, месец! }}]] | [[ {{ safesubst:#if:1| }} |{{ safesubst:#if:1| Недостаје неопходни параметар 1, месец! }}]] }} | {{ safesubst:#if:1| Недостаје неопходни параметар 1, месец! }} }} }}}} String Module Error: Target string is empty)}}">]]{{#if:
| {{{post-text}}}
}}]|[потребна одредница]
}}, which might include {{templates}}.|scroll|overflow:auto; white-space:pre; width:auto;">{{#switch:{{{2}}}|nowiki|nw={{{3}}}|{{{2}}}}}|white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word;">{{#switch:Your text{{#if:
|[[{{{1}}}|{{ #if: | | {{{1}}} }}]]
}}{{#switch:¬
|¬= |SUBST=
}}{{#if:|{{#ifeq:{{{name}}}|Pre2||{{#if:||}}}}}}{{#if:
|[{{#if:
|{{{pre-text}}}
}}[[Википедија:Чишћење|<span title="Википедија:Чишћење{{#if:| ({{#if:{{ safesubst:#if:1|}}|{{#switch:{{#if:{{ safesubst:#if:1|}} |{{#switch:{{ safesubst:#if:1|}} |january|jan|јануар|јан|januar=1 |february|feb|фебруар|фебуар|феб|фебр|februar=2 |march|mar|март|мар|mart=3 |apr|april|апр|април=4 |may|мај|maj=5 |june|jun|јуни|јун|juni=6 |july|jul|јули|јул|juli=7 |august|aug|август|аугуст|авг|ауг|avgust|avg=8 |september|sep|sept|септембар|сеп|септ|septembar=9 |october|oct|октобар|окт|oktobar|okt=10 |november|nov|новембар|нов|novembar=11 |december|dec|децембар|дец|decembar=12 |{{#ifexpr:{{ safesubst:#if:1|}}<0 |{{#ifexpr:(({{ safesubst:#if:1|}})round 0)!=({{ safesubst:#if:1|}}) |{{#expr:12-(((0.5-({{ safesubst:#if:1|}}))round 0)mod 12)}} |{{#expr:12-(((11.5-({{ safesubst:#if:1|}}))round 0)mod 12)}} }} |{{#expr:(((10.5+{{ safesubst:#if:1|}})round 0)mod 12)+1}} }} }} |{{ safesubst:#if: | {{ safesubst:#if: | {{ safesubst:#ifeq: | yes | [[ {{ safesubst:#if:1| }}|{{ safesubst:#if:1| }}]] | [[|{{ safesubst:#if:1| }}]] }} | {{ safesubst:#if:1| }} }} | {{ safesubst:#if: | {{ safesubst:#ifeq: | yes | [[ {{ safesubst:#if:1| Недостаје неопходни параметар 1, месец! }} |{{ safesubst:#if:1| Недостаје неопходни параметар 1, месец! }}]] | [[ {{ safesubst:#if:1| }} |{{ safesubst:#if:1| Недостаје неопходни параметар 1, месец! }}]] }} | {{ safesubst:#if:1| Недостаје неопходни параметар 1, месец! }} }} }} }}|1=јануар|2=фебруар|3=март|4=април|5=мај|6=јун|7=јул|8=август|9=септембар|10=октобар|11=новембар|12=децембар|{{ safesubst:#if: | {{ safesubst:#if: | {{ safesubst:#ifeq: | yes | [[ {{ safesubst:#if:1| }}|{{ safesubst:#if:1| }}]] | [[|{{ safesubst:#if:1| }}]] }} | {{ safesubst:#if:1| }} }} | {{ safesubst:#if: | {{ safesubst:#ifeq: | yes | [[ {{ safesubst:#if:1| Погрешан унос за неопходни параметар 1, месец! }} |{{ safesubst:#if:1| Погрешан унос за неопходни параметар 1, месец! }}]] | [[ {{ safesubst:#if:1| }} |{{ safesubst:#if:1| Погрешан унос за неопходни параметар 1, месец! }}]] }} | {{ safesubst:#if:1| Погрешан унос за неопходни параметар 1, месец! }} }} }}}}|{{ safesubst:#if: | {{ safesubst:#if: | {{ safesubst:#ifeq: | yes | [[ {{ safesubst:#if:1| }}|{{ safesubst:#if:1| }}]] | [[|{{ safesubst:#if:1| }}]] }} | {{ safesubst:#if:1| }} }} | {{ safesubst:#if: | {{ safesubst:#ifeq: | yes | [[ {{ safesubst:#if:1| Недостаје неопходни параметар 1, месец! }} |{{ safesubst:#if:1| Недостаје неопходни параметар 1, месец! }}]] | [[ {{ safesubst:#if:1| }} |{{ safesubst:#if:1| Недостаје неопходни параметар 1, месец! }}]] }} | {{ safesubst:#if:1| Недостаје неопходни параметар 1, месец! }} }} }}}} String Module Error: Target string is empty)}}">]]{{#if:
| {{{post-text}}}
}}]|[потребна одредница]
}}, which might include {{templates}}.|nowiki|nw={{{2}}}|Your text{{#if:
|[[{{{1}}}|{{ #if: | | {{{1}}} }}]]
}}{{#switch:¬
|¬= |SUBST=
}}{{#if:|{{#ifeq:{{{name}}}|Pre2||{{#if:||}}}}}}{{#if:
|[{{#if:
|{{{pre-text}}}
}}[[Википедија:Чишћење|<span title="Википедија:Чишћење{{#if:| ({{#if:{{ safesubst:#if:1|}}|{{#switch:{{#if:{{ safesubst:#if:1|}} |{{#switch:{{ safesubst:#if:1|}} |january|jan|јануар|јан|januar=1 |february|feb|фебруар|фебуар|феб|фебр|februar=2 |march|mar|март|мар|mart=3 |apr|april|апр|април=4 |may|мај|maj=5 |june|jun|јуни|јун|juni=6 |july|jul|јули|јул|juli=7 |august|aug|август|аугуст|авг|ауг|avgust|avg=8 |september|sep|sept|септембар|сеп|септ|septembar=9 |october|oct|октобар|окт|oktobar|okt=10 |november|nov|новембар|нов|novembar=11 |december|dec|децембар|дец|decembar=12 |{{#ifexpr:{{ safesubst:#if:1|}}<0 |{{#ifexpr:(({{ safesubst:#if:1|}})round 0)!=({{ safesubst:#if:1|}}) |{{#expr:12-(((0.5-({{ safesubst:#if:1|}}))round 0)mod 12)}} |{{#expr:12-(((11.5-({{ safesubst:#if:1|}}))round 0)mod 12)}} }} |{{#expr:(((10.5+{{ safesubst:#if:1|}})round 0)mod 12)+1}} }} }} |{{ safesubst:#if: | {{ safesubst:#if: | {{ safesubst:#ifeq: | yes | [[ {{ safesubst:#if:1| }}|{{ safesubst:#if:1| }}]] | [[|{{ safesubst:#if:1| }}]] }} | {{ safesubst:#if:1| }} }} | {{ safesubst:#if: | {{ safesubst:#ifeq: | yes | [[ {{ safesubst:#if:1| Недостаје неопходни параметар 1, месец! }} |{{ safesubst:#if:1| Недостаје неопходни параметар 1, месец! }}]] | [[ {{ safesubst:#if:1| }} |{{ safesubst:#if:1| Недостаје неопходни параметар 1, месец! }}]] }} | {{ safesubst:#if:1| Недостаје неопходни параметар 1, месец! }} }} }} }}|1=јануар|2=фебруар|3=март|4=април|5=мај|6=јун|7=јул|8=август|9=септембар|10=октобар|11=новембар|12=децембар|{{ safesubst:#if: | {{ safesubst:#if: | {{ safesubst:#ifeq: | yes | [[ {{ safesubst:#if:1| }}|{{ safesubst:#if:1| }}]] | [[|{{ safesubst:#if:1| }}]] }} | {{ safesubst:#if:1| }} }} | {{ safesubst:#if: | {{ safesubst:#ifeq: | yes | [[ {{ safesubst:#if:1| Погрешан унос за неопходни параметар 1, месец! }} |{{ safesubst:#if:1| Погрешан унос за неопходни параметар 1, месец! }}]] | [[ {{ safesubst:#if:1| }} |{{ safesubst:#if:1| Погрешан унос за неопходни параметар 1, месец! }}]] }} | {{ safesubst:#if:1| Погрешан унос за неопходни параметар 1, месец! }} }} }}}}|{{ safesubst:#if: | {{ safesubst:#if: | {{ safesubst:#ifeq: | yes | [[ {{ safesubst:#if:1| }}|{{ safesubst:#if:1| }}]] | [[|{{ safesubst:#if:1| }}]] }} | {{ safesubst:#if:1| }} }} | {{ safesubst:#if: | {{ safesubst:#ifeq: | yes | [[ {{ safesubst:#if:1| Недостаје неопходни параметар 1, месец! }} |{{ safesubst:#if:1| Недостаје неопходни параметар 1, месец! }}]] | [[ {{ safesubst:#if:1| }} |{{ safesubst:#if:1| Недостаје неопходни параметар 1, месец! }}]] }} | {{ safesubst:#if:1| Недостаје неопходни параметар 1, месец! }} }} }}}} String Module Error: Target string is empty)}}">]]{{#if:
| {{{post-text}}}
}}]|[потребна одредница]
}}, which might include {{templates}}.}} }}
See also
- {{pre}}, which mimics <pre> tags as rendered with the monobook Wikipedia skin
- <pre>…</pre>
- Word wrapping
{{#ifeq:Pre2|sandbox | |
}}