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
- Indented code blocks (4 spaces) work without backticks but lack language hints. Use ``` for portability.