THE GITHTML FIELD GUIDE

Keep underscores in Markdown identifiers from becoming emphasis

Put filenames, variable names, and other exact identifiers in inline code instead of relying on emphasis punctuation. This makes their boundaries clear and reduces parser-dependent surprises around underscores. Use ordinary emphasis only for prose. For a long command or pattern, provide a fenced example and explain the token's purpose separately.

Recognize when the text is an identifier

A name such as report_cache_key is not an ordinary phrase that needs visual emphasis; it is an exact token a reader may search for or copy. Treat it as code even if the current renderer happens to preserve its underscores without help. This convention makes source intent obvious and avoids dependence on subtle punctuation rules. Do not capitalize or rewrite an identifier to fit prose style. Instead, rephrase the surrounding sentence so the token remains unchanged. For a user-facing label, use the exact visible wording and explain whether it differs from the underlying configuration key.

Keep emphasis and literal syntax separate

The example contrasts a literal setting name with emphasized explanatory prose. Avoid wrapping a long technical token in several layers of asterisks and backticks just to make it stand out; excessive styling can make copying and source editing harder. If the identifier itself contains backticks or meaningful spaces, choose an appropriate code delimiter or fenced block. A bare underscore in ordinary prose may need a targeted escape, but bulk escaping every underscore is unnecessary and can damage code examples. Work from the reader's need for an exact token rather than from a desire to eliminate every punctuation character.

markdown
Set `report_cache_key` to the documented value.

The setting is **required** for this illustrative workflow.

Check the rendered and copied forms

Preview the sentence and copy the identifier into a scratch buffer. Compare spelling, case, underscores, hyphens, and any trailing punctuation with the authoritative source. These small differences are easy to miss when a token appears visually emphasized. Search the document for other occurrences and standardize their presentation without altering the actual values. For configuration guidance, confirm that the name still exists in the documented software version. A perfectly formatted obsolete identifier is still wrong. Include the token in a complete example when readers need context about where it belongs, but keep unsupported defaults or behavior out of the explanation. During review, distinguish an illustrative token from a real project setting. Label invented examples explicitly so a reader does not assume every code-styled name can be configured in the actual product.

  1. Classify the text as a literal identifier or ordinary prose before choosing formatting.
  2. Copy the rendered token and compare it character by character with its source definition.
  3. Standardize presentation across the guide without changing case or punctuation in real names.
  4. Use a complete fenced example when an isolated identifier leaves its placement ambiguous.

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

Keep underscores in Markdown identifiers from becoming emphasis · gitHtml