20th March 2021 at 9:49am
Code blocks work much like block quotes, only they begin and end with ```
instead of <<<
, and they display their contents in a fixed-width font, respecting line breaks. If you install the official Highlight plugin, you can also specify a language for syntax highlighting after the opening backticks.
Let's say hello to the world in Python, without syntax highlighting:
```
print("Hello world!")
```
Let's add syntax highlighting by specifying a language (Highlight plugin must be installed):
```python
print("Hello world!")
```
How about in JavaScript?
```javascript
console.log("Hello world!")
```
Let's say hello to the world in Python, without syntax highlighting:
print("Hello world!")
Let's add syntax highlighting by specifying a language (Highlight plugin must be installed):
print("Hello world!")
How about in JavaScript?
console.log("Hello world!")