Addendum: At least on SO, when the code starts or ends with `
, you need to add spaces inside of backticks on both sides.
That is, if you want foo`
, you must spell it as `` foo` ``
, not as ``foo` ``
, because the latter incorrectly renders as foo`
.
At most one whitespace is removed in this manner (from each side), so ` foo `
renders as foo
.
Note that different rules apply inside comments. There, escape the backtick you want displayed, e.g. type `foo\``
to get foo`
inside a comment. See the section Backticks within backticks at the end of this community wiki.