Skip to content
Astera Technology

Wrap a long token without deleting characters

Keep an unbroken identifier readable inside 180px without ellipsis or clipping.

The full token wraps inside its 180px box.

Download complete case notes and answer keys ↓

Inspect the working example

The paragraph contains one fixed filename-like identifier with no spaces. overflow-wrap:anywhere supplies emergency break opportunities without changing the underlying string.

Inputs and native observations
CaseInput or inspectionResult and meaning
Text contentCompare before/after wrappingThe exact identifier is unchanged
Box widthMeasure the paragraph180px
OverflowCompare scrollWidth and clientWidthNo horizontal token overflow in the working fixture
Download editable CSV ↓

Follow the browser mechanism

Emergency wrapping changes line opportunities, not data. It is useful for a token whose normal breaks are absent. Ellipsis and clipping solve a different presentation task by hiding some visible content. Exact line counts depend on font metrics.

Normal wrapping leaves this token unbroken

The alternative keeps the same width but restores normal wrapping.

Counterexample source; inspect separately
<style>body{margin:8px}</style>
<style>.token{width:180px;overflow-wrap:normal}</style><p class="token">workshop_local_example_identifier_without_spaces</p>

The supplied token has scrollWidth greater than clientWidth. Adding overflow:hidden would hide its tail rather than make it readable.

Try the repair

If textContent is complete but the tail is clipped, has the visible reading task passed?

Show the worked answer

No. Data retention and visible readability are separate checks; require a route to all characters.

  • Check retained text, overflow and multiple rendered lines.
  • Do not hardcode a cross-engine line count.

Original example files

Related resources