Search code examples
markdownbackticks

quote back-tick quote...enclosed in back-ticks


I have a code snippit like:

console.log('`', '...')

The first argument to log here is quote, back-tick, quote.

I would like to embed this in a sentence in a markdown document like:

this code `code` is foo.

But, when I try this:

this code `console.log('`', '...')` is foo.

it's not coming out right because of the nested back-tick characters.

Any advice on how to correctly escape the back-ticks?


Solution

  • Use double backticks around the code block:

    ``console.log('`', '...')``
    

    This has been tested on dillinger.io and it appears to be working.