Template:Syntaxhighlight: Difference between revisions
Appearance
Content deleted Content added
Caleb Cooper (talk | contribs) Created page with "{{#tag:syntaxhighlight|{{{code|{{{1}}}}}}|lang="{{{lang|{{{2|text}}}}}}"|{{#ifeq:{{{border|}}}|no|style="border: none !important"}}}}<noinclude> {{documentation}} </noinclude>" |
(No difference)
|
Latest revision as of 19:44, 4 November 2020
{{{1}}}
Simple wrapper around the <syntaxhighlight> tag to show syntax-highlighted text. Unlike <syntaxhighlight>, text that does not fit on the screen will be wrapped.
Usage
Parameters
- lang:
- code: The contents of the syntax highlighted block.
Examples
{{syntaxhighlight|lang=javascript|code=mw.util.addPortletLink('p-personal', '/w/index.php?title=Special:MyPage/Sandbox&action=edit&preload=Template%3AUser_sandbox%2Fpreload&editintro=Template%3AUser_sandbox', 'My sandbox', 'pt-mysandbox', 'Go to my sandbox');}}
mw.util.addPortletLink('p-personal', '/w/index.php?title=Special:MyPage/Sandbox&action=edit&preload=Template%3AUser_sandbox%2Fpreload&editintro=Template%3AUser_sandbox', 'My sandbox', 'pt-mysandbox', 'Go to my sandbox');