white-space Collapse Behavior Table
Supported legacy white-space shorthand behavior, not context-dependent text-transform/line-breaking computation. Explicit supplied computed/layout context only; not a browser cascade/layout engine or cross-browser guarantee.
Description
White-space handling controls collapsing, preserved breaks and wrapping.
White-space handling controls collapsing, preserved breaks and wrapping.1
Similar-looking text can therefore produce different lines under different policies. Use white-space Collapse Behavior Table to look up a supported term.
When to use white-space Collapse Behavior Table
Use white-space Collapse Behavior Table to look up a supported term. Choose the exact supported token from the table; preserve its punctuation and capitalization.
How to use white-space Collapse Behavior Table and understand its results
- Choose the exact supported token from the table; preserve its punctuation and capitalization.
- Enter White space using the field table and validation rules below, then run the tool.
- Read Meaning and interpret units, signs, ordering and placeholders as explained below.
- If the tool reports an input error, correct that field and rerun. A successful false result, empty match list or unknown-evidence placeholder has the specific meaning described here; check the limitations before applying the result.
| Input field | Meaning | Value type | Requirement |
|---|---|---|---|
| whiteSpace | White space | string | Required; constraints below |
Enter one of the exact supported whiteSpace tokens in the table below. The implementation performs a case-sensitive lookup and returns the stored meaning without interpreting a stylesheet, audio recording or performance. Unsupported tokens, added whitespace and alternate capitalization are input errors. The entries describe a bounded vocabulary rather than every valid value in the wider topic.
meaning = storedTable[exactSupportedToken] Field order, units and branch conditions follow the implementation explanation above.
| Exact supported token | Stored meaning |
|---|---|
| normal | collapse spaces and segment breaks; allow wrapping |
| nowrap | collapse spaces and segment breaks; suppress wrapping |
| pre | preserve spaces and segment breaks; suppress wrapping |
| pre-wrap | preserve spaces and segment breaks; allow wrapping |
| pre-line | collapse spaces, preserve segment breaks; allow wrapping |
| break-spaces | preserve spaces and segment breaks, wrap opportunities after preserved spaces |
| Output field | Meaning | Value type |
|---|---|---|
| meaning | Stored explanation for the exact supported token. | string |
{
"input": {
"whiteSpace": "pre-line"
},
"output": {
"meaning": "collapse spaces, preserve segment breaks; allow wrapping"
}
} Limitations and assumptions
Similar-looking text can therefore produce different lines under different policies. Apply the exact scope and assumptions described above.
All listed fields require explicit values. Unexpected fields, incorrect types, nonfinite numbers and sparse arrays fail validation. Domain-specific bounds, alignments and supported tokens are stated above; extremely large inputs or outputs can also be rejected. These errors differ from successful results such as false, no matches or unknown evidence.
Alternative or Complementary methods
Use word-break vs overflow-wrap Compare for a related task: Word-breaking policies affect where text may wrap and how intrinsic width is calculated.
Use text-align:justify Last-Line Behavior for a related task: Last-line alignment can differ from the justification of preceding lines.
References
-
white-space Collapse Behavior Table — tool.io
Similar or alternative tools
- word-break vs overflow-wrap Compare
Word-breaking policies affect where text may wrap and how intrinsic width is calculated.
- text-align:justify Last-Line Behavior
Last-line alignment can differ from the justification of preceding lines.