Stepan Parunashvili
Stepan Parunashvili

Reputation: 2845

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?

Upvotes: 3

Views: 333

Answers (1)

Chris
Chris

Reputation: 137268

Add a space at the beginning and the end:

`` `foo bar ``

This renders as

`foo bar

both on Stack Overflow and GitHub.

Upvotes: 4

Related Questions