angular-ellipsis icon indicating copy to clipboard operation
angular-ellipsis copied to clipboard

Truncate long words

Open AlessandroSantamaro opened this issue 8 years ago • 2 comments

Hi, thanks for you work! I notice that there is an issue if a word is too long... the plugin doesn't truncate words, for example if my text is:

abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvwxyz123456789Four score

I can see only:

abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvw

There is an example with demo script: ellipsis-long-word

Any ideas for a solution? Thanks again for the plugin!

Alessandro

AlessandroSantamaro avatar Aug 17 '16 07:08 AlessandroSantamaro

I had this same issue. Here is my quick fix

<p data-ng-bind="paragraphText" data-ellipsis data-ellipsis-separator="" style="word-break: break-all;"></p>

Add data-ellipsis-separator="" and set the style of the element word-break: break-all

Note: This is not a perfect fix

kagant15 avatar Nov 09 '16 17:11 kagant15

+1 Another alternative is to use: word-wrap: break-word but ellipsis will not occur and you will have to overflow: hidden. work-break does tend to be agressive in normal situations.

hspier avatar Feb 24 '17 17:02 hspier