Typing
\`foo\`
produces `foo` instead of the desired literal backticks. It appears correctly in the preview however.
Meta Stack Exchange is a question and answer site for meta-discussion of the Stack Exchange family of Q&A websites. It only takes a minute to sign up.
Sign up to join this communityTyping
\`foo\`
produces `foo` instead of the desired literal backticks. It appears correctly in the preview however.
This was an actual bug in early versions of the official Markdown Perl implementation
http://code.google.com/p/markdownsharp/source/detail?r=7c443c9d037a8b657965aefcfba10824ff258ba2
According to the Markdown reference:
The backtick delimiters surrounding a code span may include spaces — one after the opening, one before the closing. This allows you to place literal backtick characters at the beginning or end of a code span
A single backtick in a code span: `
A backtick-delimited string in a code span: `foo`
Test:
\`foo`
`foo`
<code>`foo`</code>
foo
`foo`
`foo`
``foo``
`foo`
<code>`foo`</code>
`foo`
Nested backticks with backslash escapes:
`foo \`bar\``
foo \
bar``
Note that the code formatting button does not help here. It changes
foo `bar`
to
`foo `bar
foo
bar
How about double back ticks?
``foo `bar```
``foo `bar```
Probably have to resort to <code>
<code>foo `bar`</code>
foo
bar
with entities
<code>foo `bar`</code>
foo `bar`
with backslash
<code>foo \`bar\`</code>
foo `bar`
This is a proper `backticked piece` without any gray background, or monotype font.
Instead of using `escaped backticks` which look ugly, you can use simple HTML entities, which will not be treated wrongly by the SO server parser. That's a workaround, not a fix of this bug, of course :)
Like so (`
is the HTML Entity for the backtick):
This is a proper `backticked piece`
Inside post comments, you should use the "normal" way, as for some odd reason, HTML entities are written as text in comments:
use \`normal escape\` in comments, HTML entities don't work
`
from the code block and replaced it with `
, while that was really the whole clue of the workaround... I added that part back again.
– Abel
Nov 11 '09 at 16:47
``backtick` testing
``foo` ` gives us
``foo
If you don't want "foo" in monospace, you can use this:
`` `foo` ` ` gives us
`` foo
but then you get spaces around foo.
<backtick><backtick>foo<backtick><space><backtick>
.
– Hilarious Comedy Pesto
Aug 5 '09 at 18:55
`
- desired is a literal non formatted backtic and a code formatted backtick. (slash tic tic slash tic tic)
– jjnguy
Aug 5 '09 at 19:03
yes monospace
in the comment.
– Abel
Nov 10 '09 at 22:51
According to http://daringfireball.net/projects/markdown/syntax#code :
To include a literal backtick character within a code span, you can use multiple backticks as the opening and closing delimiters:
``There is a literal backtick (`) here.`` which will produce this:
<p><code>There is a literal backtick (`) here.</code></p>
For example, if I can write this: foo`bar
like this:
``foo`bar``
\BACKTICKfoo\BACKTICK
to work properly either. – TheTXI Aug 5 '09 at 18:45meta
" discussion. – Kzqai Jul 11 '11 at 16:03cd `cat foo`
but not in questions and answers – Old Pro May 31 '12 at 20:48