How to Have Two (or More) Consecutive Backticks in Inline Markdown Code?

Adding consecutive backticks in markdown inline code block

To render backticks inside an inline code block in markdown, you must wrap the inline code block with two (or more) backticks:

`` `foo` `` # renders `foo`

Here, the surrounding backticks:

  1. Signal the start and end of an inline code block;
  2. Should be different in count than the number of consecutive backticks you wish to display, so that the interpreter can correctly render them.

This means that when you surround an inline code block with double backticks for example, it would not be able to display two consecutive backticks within the inline code block (as each pair of backticks would signal the start and end of a new inline code block):

`` ``foo`` `` # renders foo

In such a case, you must wrap the code with a different number of surrounding backticks than the ones you wish to render, so that the interpreter can correctly render them:

``` ``foo`` ``` # renders ``foo``

As long as the number of consecutive backticks within the inline code block are different from the surrounding ones, it should work for any combination of backticks you wish to display. In the following example, you can see that there are four backticks that wrap the inline code block, allowing you to render any combination of consecutive backticks other than four:

```` `foo``bar``` ```` # renders `foo``bar```

Hope you found this post useful. It was published . Please show your love and support by sharing this post.