- 🇩🇪Germany Anybody Porta Westfalica
Now I'm seeing words are no more trimmed at the end of the word, but there's still no option to select, if it *should* trim after while words or at the character. Could a maintainer perhaps clarify, what's the expected behavior?
Would you agree an option for that makes sense? Then we'd be happy to provide a MR!
- 🇺🇸United States ultimike Florida, USA
I'm not sure I agree with this:
Truncating by characters currently truncates at word boundary, not directly at given char count. That's unexpected and should be documented. It would be even better to add an option to enable / disable this functionaly.
One of the main features of Smart Trim is that it doesn't cut off words. If you want to cut off at a specific character count regardless of whether it is a word-boundary or not, why not use the core "Trim" formatter?
-mike
- 🇩🇪Germany Anybody Porta Westfalica
Thanks @ultimike! Well I think smart_trim has many additional benefits, that would even be helpful, if trimming at character count.
The strange thing and primary reason for this issue is, that I have a case, where words are cut off in the middle using smart_trim and I was wondering a lot, how that happens... thanks for the clarification, so I'll have to have a look at the code and debug for the reasons... I wasn't sure anymore if smart_trim preserves the whole word.
- 🇮🇪Ireland lostcarpark
This issue has been open nearly a year, and I don't think there's a clear description of what the problem is. @Anybody, if words are getting split, that does sound like a possible bug, as it's definitely not the described behaviour of the module.
Could you provide an example of some text, with the output Smart Trim is producing, and the output you'd expect?
- 🇩🇪Germany Anybody Porta Westfalica
Thanks, yes I'll add that here, once I run into it again next time. Sadly I don't remember anymore in which of the many projects I ran into this. So let's please leave this open.
If nobody else runs into this, that's also a good indicator of another side effect. So let's see!
- 🇩🇪Germany Grevil
This issue has been open nearly a year, and I don't think there's a clear description of what the problem is. @Anybody, if words are getting split, that does sound like a possible bug
I think that is not the problem he was facing. From the issue summary:
Truncating by characters currently truncates at word boundary, not directly at given char count.
So basically, if we have the sentence:
Hello World
and we want to trim the sentence at character 3, @Anybody expects the output to be:
Hel
Instead, the module resolves the sentence into:
Hello World
Which he thinks is unexpected and not documented enough.And this issue is dedicated to having a setting with which you can switch between both trimming behaviors. Hope that clears it up!
- First commit to issue fork.
- @markie opened merge request.