Break points after a slash or a hyphen

A justified column set twice: file paths and compounds running past the edge with no break points, then wrapping where a break after a slash or a hyphen is allowed.

Break only at spaces and a file path becomes one very long word. So does a hyphenated compound, and so does a part reference full of slashes. This page sets the same paragraph twice: above, breaking at spaces alone, so those pieces run past the column's right edge; below, breaking after a slash or a hyphen as well.

The break keeps the character on the line it belongs to, which is what a reader expects of a path: the slash stays at the end of the upper line rather than opening the lower one. No hyphen is invented anywhere, so nothing is added to the text that was not written in it.

What this example shows

  • Break points allowed after a slash and after a hyphen.
  • The breaking character kept at the end of the line it ends.
  • Long paths wrapped without inventing a hyphen.

The code, in full

The same document is written twice, once in each language. Both files are shown in full, with the code coloured on the server, and can be copied in one click.

The document itself

The same document is written in each of these languages. Open the one you want to look at.

Open the document in English Open the document in French

Read the Rust source Read the Python source

First page of Break points after a slash or a hyphen

What this document weighs

Before 109,804 bytes
Now 39,250 bytes
Saved 64.3 %

Not one mark on the page changed. See every document measured.

Examples near this one

Soft hyphens and no-break spaces

A justified column set twice: the long words breaking at their soft hyphens with a hyphen shown, or left whole, and a figure a no-break space keeps together.

Text poured into columns

One long passage poured into three columns, each fitting the lines its height allows and handing the rest to the next.

Every example, by subject