Closed subsoap closed 5 years ago
Hmm, good suggestion. Maybe add an option table as a third argument with an option to truncate full words/to word boundary:
richtext.truncate(words, length, { full_word = true }) -- option name?
yes, settings table would work for this
@subsoap I need to discuss the design a bit more:
11111111112
12345678901234567890
Hi my name is Slim Shady
truncate(words, 16)
11111111112
12345678901234567890
Hi my name is Sl
truncate(words, 16, { full_word = true })
11111111112
12345678901234567890
Hi my name is
Yes, you should "round down" the words"
Although when truncating full words the counter should probably be for the actual word count and not the character accounts, single words would be a single number in the total truncation value
Good point. This has been implemented and released in 5.9.0
Multiple &zwsp; with no spaces between are considered a single word. Probably want them each to be considered their own word no matter what because otherwise defeats their purpose as a timer buffer without modifying formatting.
Good point. This is required when truncating per word.
Would be a useful option