Closed sarn0ld closed 5 years ago
The method is supposed to crop text using word boundaries, not actual character limits. So if a word exceeds the character limit then the method will remove the word and replace it with ...
.
This just looks a little cleaner than abruptly cropping the sentence mid-word. We can add a boolean param that allows text to be cropped on an actual character limit though...
Thank you for the information! Then I wouldn't add the cropping on actual char limit, but do these fixes, so that my test_crop method is green:
I opened a PR as suggestion
While writing tests i found some strange behaviour in the crop()-function in utils.py. Not sure what was intended for this to do exactly. However this needs refactoring. See test_crop() for further information!