Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you write a literal backtick in the beginning of a markdown code block?

I know that to represent a literal backtick inside a code block, I could start with a "different number of backticks"

``foo ` bar``

This produces:

foo ` bar

However, what if I want my literal backtick to be the beginning of the code block? i.e:

```foo bar``

This does not work:

```foo bar``

If I add a space in the beginning, it will:

`foo bar

Is there a way I can achieve this without a space?

like image 497
Stepan Parunashvili Avatar asked Dec 05 '25 02:12

Stepan Parunashvili


1 Answers

Add a space at the beginning and the end:

`` `foo bar ``

This renders as

`foo bar

both on Stack Overflow and GitHub.

like image 128
Chris Avatar answered Dec 07 '25 23:12

Chris