Open mswebdesign opened 2 years ago
This string appears to truncate correctly in an older version (0.2.0
).
I've put together a potential fix as a PR
The basic problem appears to be that the 160th character in that string is a space. The code gets confused and thinks that it failed to find any breakpoints it can use.
Yep, works like a charm. Please merge. Thanx!
If I apply ellipsize like this, an empty string is returned:
ellipsize( 'Digitale Bildung durch Computational Thinking: Der Erwerb fächerübergreifender Problemlösekompetenz zugunsten eines reflektiert-partizipativen Medienumgangs in der spannenden Welt von Coding und Robotik - Angebot eines Praxisworkshops für Grundschullehrkräfte anlässlich des Digitaltags 2022', 160, { truncate: false } )