Can I determine which characters are allowed to “break” a word?

I am showing long veeeery urls in my Safari extension. Obviously, they cannot fit on the same line. Currently, pagination rules make most URLs appear on two lines: the first is quite short and ends with a character ?, and the other is ridiculously long and contains all the other parameters GET.

I would like to make the words also break above the symbol &, without screwing, if possible, a copy. I tried replacing each &with &\u00ad( &+ a soft hyphen character), but it was somehow strange to see a hyphen after &when there really wasn’t in the URL.

I thought there was something with CSS3 for this problem, but I can not find it.

Any suggestion is welcome if it works with Safari.

+3
source share
2 answers

Perhaps <wbr>this is what you are looking for.

+5
source

<wbr>is a good answer, but you can also consider an object of spatial width without width. I haven't used it a lot, but this article suggests using the following css to extend cross browser features:

wbr:after { content: "\00200B" }
+1
source

Source: https://habr.com/ru/post/1750530/


All Articles