Fenced Code Blocks with Syntax Highlighting

Multi-line code blocks with language hints

Markdown Source

```javascript
function greet(name) {
  return `Hello, ${name}!`;
}
```

Rendered HTML Output

<pre><code class="language-javascript">function greet(name) {
  return `Hello, ${name}!`;
}</code></pre>

Explanation

Use three backticks (```) on a line before and after your code. Add a language identifier after the opening backticks (e.g., javascript, python) for syntax highlighting.

Tips & Common Mistakes

Related Markdown Examples

Try It

Markdown Preview Tool →

All Examples