In this example, `<section></section>` should be wrapped as **code**.
Renders to:
In this example, <section></section> should be wrapped as code.
HTML:
<p>In this example, <code><section></section></code> should be wrapped as <strong>code</strong>.</p>
Indented code
Or indent several lines of code by at least two spaces, as in:
// Some comments line 1 of code line 2 of code line 3 of code
Renders to:
// Some comments
line 1 of code
line 2 of code
line 3 of code
HTML:
<pre> <code> // Some comments line 1 of code line 2 of code line 3 of code </code></pre>
Block code "fences"
Use "fences" ``` to block in multiple lines of code.
Sample text here...
HTML:
<pre> <code>Sample text here...</code></pre>
Syntax highlighting
GFM, or "GitHub Flavored Markdown" also supports syntax highlighting. To activate it, simply add the file extension of the language you want to use directly after the first code "fence", ```js, and syntax highlighting will automatically be applied in the rendered HTML.
See [Code Highlighting]({{< ref "syntaxhighlight.md" >}}) for additional documentation.
For example, to apply syntax highlighting to JavaScript code: