Not truncate the text properly


#1

This is configuration I am using {{ include.description | truncate: 137, "..." }}


#2

can you be more specific with what the problem is? I don’t really want to count the letters in each one to see what the difference is.


#3

I don’t really want to count the letters in each one to see what the difference is.

I can understand :joy:

Here’s the plan, I want to keep the description within 3 lines and for that, I truncate the text.

The problem is that all three of them are being truncate at different length.


#4

have you counted them to see how many characters they are? I’m guessing they are the same number, but based on how many letters are in the last word on each line may make the word flow to the next line. I don’t think you can get a full 3 lines, you probably need to truncate more to catch those lines with a long word at the end. Your middle example line 1 is a good example I think. Also the … counts towards the count I think. Maybe try 125.


#5

I have checked the character in each of the description.

In the first one: 121
Second: 137
Third: 137

Now the problem is that even though last two have same number of character then why it is number truncating the text to same length.