Help:Editing: Difference between revisions

ArrowHead294 (talk | contribs)
m Syntax highlighting: New section
ArrowHead294 (talk | contribs)
Line 96: Line 96:


=== Syntax highlighting ===
=== Syntax highlighting ===
[[mw:extension:SyntaxHighlight|Syntax highlighting]] is a feature to display source code in different colors and fonts to indicate the structure to readers. Wrap the desired code between <code><<nowiki />syntaxhighlight></code> tags and input the desired programming language using the <code>lang</code> parameter in the opening tag. For example:
[[mw:extension:SyntaxHighlight|Syntax highlighting]] is a feature to display source code in different colors and fonts to indicate the structure to readers. Wrap the desired code between <code><<nowiki />syntaxhighlight></code> tags and input the desired programming language using the <code>lang</code> parameter in the opening tag. Unlike in <code><<nowiki />code></code> and <code><<nowiki />pre></code> tags, everything is escaped.
 
For example:


{{#tag: syntaxhighlight
{{#tag: syntaxhighlight
|{{^(}}syntaxhighlight lang="wikitext"{{)^}}
|{{^(}}syntaxhighlight lang="wikitext"{{)^}}
<!-- Comment -->
{{^(}}!-- Comment --{{)^}}


[[Wiki]] markup &amp; '''bold''' ''italic'' text
[[Wiki]] markup &amp; '''bold''' ''italic'' text