THE GITHTML FIELD GUIDE

Use optional break points in long displayed identifiers

Use wbr to suggest safe line-break opportunities inside long displayed strings without inserting a visible hyphen. Keep the actual link destination or machine value intact. For text that readers must copy exactly, test the copied result and explain any presentation choices rather than silently adding spaces or punctuation.

Choose the right representation

A long hierarchical identifier can extend beyond a narrow reading column even when ordinary prose wraps correctly. Breaking at meaningful boundaries helps readers recognize its parts. An arbitrary break in the middle of a segment can make two different identifiers harder to compare.

Apply the pattern deliberately

Insert optional breaks in the displayed label at separators that already express hierarchy. Do not modify an href or data value merely to make the label fit. If exact copying is central to the task, a locally scrollable code block may be safer than aggressive wrapping.

  1. Choose break points at meaningful segment boundaries rather than after a fixed character count.
  2. Keep the underlying destination or value separate from its wrapped display label.
  3. Compare the copied string character for character with the original before adopting the pattern.
html
<p>Identifier: <code>payments.<wbr>settlement.<wbr>reconciliation</code></p>

Choose between a wrapped label and an exact-copy block

A hierarchical name such as payments.settlement.reconciliation already contains useful segment boundaries. Placing an optional break after each separator lets the reader keep those segments together when space permits. A fixed rule that breaks after every tenth character can split a meaningful segment and make comparison harder. For an opaque checksum or random identifier, there may be no meaningful internal boundary; a scrollable exact-copy block can be the more honest presentation.

Keep the label and the underlying value separate. An anchor can display a readable label while its href retains the complete destination. Do not insert formatting tags, spaces, or line breaks into the destination attribute. Likewise, do not modify a value in a downloadable configuration file merely because the corresponding documentation label needed wrapping. The document should make clear which representation is for reading and which is the exact value to use.

Verify copying in the particular delivery format. A browser selection, a PDF export, and an email conversion do not necessarily preserve text identically. Paste the selected identifier into a plain-text comparison and inspect every separator, space, and hyphen. A visual break is not supposed to become part of the identifier. If a downstream export changes it, provide an unambiguous plain-text version and explain where to copy from. Avoid claiming universal copy safety on the basis of one successful browser test.

Check the finished reading experience

Try selecting the whole identifier and pasting it into a plain-text field. Confirm that the result matches the authoritative value and that no displayed hyphen is mistaken for part of the identifier.

Sources and further reading

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

All reading html on your phone guides →

Read as MarkdownAll guides

Use optional break points in long displayed identifiers · gitHtml