Forum How do I...?

Line break after slash

hsivonen
How do I allow line breaking after slashes without introducing hyphens?

The use case is typesetting URLs that do not fit on one line.
mikeday
prince-linebreak-magic: auto;

In the next release this property will be enabled by default and the implementation has been improved.
hsivonen
Thanks. Works exactly as needed.

I like the property name. :-)
StoneCypher
Unicode actually provides functionality for this. Prince's custom tag for it is quite nice and convenient. However, if you need something which works in browsers, or if Prince's magic method either includes or discludes characters you need to work with, it is useful to know how to do it manually.

I should note that I'm making an assumption. You asked how to do this without introducing hyphens. I am assuming that the problem is that you don't want hyphens in your document; that is easily avoided. If you're just averse to adding things to the document because you're as lazy as I am, well, the prince property is your only trap door.

If you simply want manual breaking control, all you need to know is that Unicode provides a zero-width space. In theory this should be encoded as &zwsp; , but I've never seen *anything* that supports that entity, so don't use it. The entity should be represented in its unicode callout 16-bit decimal representation (because, for god knows what reason, MSIE can't handle the hexidecimal representations.)

To provide a point for breakage, use ​ . (If you need it for lord only knows what reason, the hex callout is ​ , but Barney the Badbear says: "Don't use hexidecimal, or I'll punch you in the mouf.")

------

Oh, that's awesome: if I write the entity, it's encoded as a space in the post, but if i try to entity encode the ampersand, it's written out, even if I have HTML disabled. I thus cannot actually write that entity such that it's displayed correctly. BBcode for the ... win?

John Haugeland is http://fullof.bs/