Skip to content

Instantly share code, notes, and snippets.

@mcandre
Last active January 25, 2024 16:06
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcandre/8d76e076b2495fd8b36f439ec5033116 to your computer and use it in GitHub Desktop.
Save mcandre/8d76e076b2495fd8b36f439ec5033116 to your computer and use it in GitHub Desktop.

GitHub-flavored Markdown does not use C-style escapes for escaping backticks inside spans. Instead, GFM uses double, significant whitespaced, backticks.

Two backticks, then a space, then a backtick, then a space, then two more backticks:

`` ` ``

produces:

`

@cbj4074
Copy link

cbj4074 commented May 16, 2017

That's interesting... thanks for the analysis.

How would one avoid the superfluous space when, say, using MySQL-style reference notation in a quoted block? For example:

In MySQL, we use `table`.`column`...

See what I mean? The extra spaces appear in the output.

Furthermore, the table and column do not receive the pre-format styling.

@cwagnello
Copy link

The stuff between the double backticks is escaped so your example would look exactly the same surrounded by a pair of double back ticks.

`` `table`.`column` ``

@dwiyatci
Copy link

To my future @dwiyatci self: if you only wanna escape backtick in regular text (not code), simply use \ (backslash) to escape it. Source here.

`Good night, Glenn.`

@dwiyatci
Copy link

`
``
```
````
...

@patbl
Copy link

patbl commented Feb 24, 2023

Can you quote backticks inside a code block inside a GitHub issue title? Using double backticks as the delimiter doesn't work in that context.

@jonathanneo
Copy link

jonathanneo commented Sep 14, 2023

@patbl

To display triple backticks in a fenced code block, wrap them inside quadruple backticks ````.

```
Look! You can see my backticks.
```

https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks

@patbl
Copy link

patbl commented Sep 14, 2023

@jonathanneo I was asking about GitHub issue titles. It seems like you can't use fenced code blocks in titles because they have just one line. Or am I missing something?

@jonathanneo
Copy link

jonathanneo commented Sep 14, 2023

@patbl I missed the part about issue titles. I'm not sure in that case.

@dwiyatci
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment