Skip to content

Escape Codeblocks

What

When writing documentation, if you want to show a user how to use a codeblock, it will look garbled as markdown won't escape it

You can use ~~~ instead of the usual `.

How to escape Codeblocks

Simply surround your code with ~~~

The text below escaped and treated like code

```python
print("hello world")
```

What about backticks?

To get a backtick to show up in a codeblock

`` ` ``

Extra Reading


Want to make this site better? Open a PR or help fund hosting costs