THE GITHTML FIELD GUIDE

Put a literal backtick inside Markdown inline code

Use a longer backtick delimiter around an inline code span that itself contains a backtick. Keep the delimiter separate from the content when necessary with spaces. For longer or whitespace-sensitive examples, use a fenced block instead; inline code is best for short tokens whose exact boundaries remain obvious to readers.

Choose between a token and a command

Inline code is useful for a filename, flag, variable, or short expression embedded in a sentence. It becomes difficult to read when the expression contains several layers of quoting. Before troubleshooting the delimiter, ask whether the reader needs to copy an entire command. If so, give that command its own fenced block and explain it below. A single literal backtick can remain inline, but a shell substitution example with several arguments is usually clearer outside the paragraph. This decision also gives you room to state the shell and whether the command is illustrative or intended to be run.

Separate wrapper syntax from the literal text

For a single backtick inside the content, use two backticks to delimit the span. The sample demonstrates a short identifier with a backtick rather than a real shell command, so it has no execution side effect. Be careful when adding surrounding spaces: Markdown code-span whitespace handling can normalize what appears in the source. Do not use an inline span to teach an exact sequence of leading or trailing spaces. If whitespace is the subject, move the example into a fenced block and describe the significant positions in prose. Keep punctuation belonging to the sentence outside the code span.

markdown
Use ``field`name`` as the literal token.

For whitespace-sensitive examples:
```text
  field`name
```

Review by copying, not only by looking

After previewing, copy the token from the rendered paragraph into a plain-text scratch buffer. Count its backticks and check that no wrapper delimiter leaked into the copied text. Repeat the check after an automated formatter or documentation converter runs. When teaching shell syntax, have a reviewer inspect the literal characters without executing the command; visual copying and safe execution are separate verification tasks. Prefer ordinary explanatory wording around the token so its role remains clear if styling disappears. A correct span should communicate both the exact token and why the reader is seeing it. Tell reviewers which characters belong to the example and which belong to the surrounding sentence. A trailing period accidentally copied into a filename can be more disruptive than an imperfect visual highlight.

  1. Move examples with several quoting layers into fenced code before attempting elaborate inline escaping.
  2. Use a harmless token to test the delimiter and copy its rendered text into a scratch buffer.
  3. Describe meaningful whitespace explicitly; do not rely on inline presentation to preserve every source space.

Sources and further reading

AI-assisted writing with source-linked guidance and illustrative examples. Read our editorial approach or report a correction.

All markdown and readme files guides →

Read as MarkdownAll guides

Put a literal backtick inside Markdown inline code · gitHtml