Use <code>
and HTML character entities instead. This is especially useful in situations where your code is already wrapping things in backticks (e.g., in Swift, enum { case `true` = 1 }
).
HTML gives you three ways to specify a character entity for a backtick: `
, `
, & `
. The choice is yours.
The way to accomplish the example with this technique would be <code>List`1</code>
, resulting in List`1
. The markdown for List`List`1
would just be <code>List`List`1</code>
. It's a little messy, but not unbearable if you're used to reading/writing HTML.
While more cumbersome than normal Markdown, this approach is also much more compatible. Some Markdown parsers don't like backslash-escapes; some will created nested code spans instead of working like @Brian's example; others will do other weird things; but the HTML approach will only fail if the Markdown parser has HTML turned completely off (which is exceedingly rare).
The general approach I take is “If I can't do it with Markdown, or if doing it in Markdown is a complicated mess of repeated symbols and tricks, just drop down to HTML for that use-case.”
Note that on SE sites, this only works in questions & answers, not comments (unfortunately! and somewhat negating my “exceedingly rate” analysis above!); HTML entities are displayed as plaintext in comments.
\
Example:`