This is present in 7.x-3.0-rc3.
I want to rewrite the results of of a text field I enter the Maximum length (in my example 120 characters) and I check
- Trim only on a word boundary
- Add an ellipsis
- Strip HTML tags
- Remove whitespace
First of all I notice that the ellipsis is not formed as … instead of which it is 3 stops - is there any reason why not?
Secondly there is an issue of the rewriting of the results. With a 'normal' node it truncates precisely on or before 120 characters, actually it trims at 117 characters plus the 3 dots. However in the conditions of acceptance tests that we are running we entered abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd and the text did not truncate at 117 or 120, instead of which it allowed the overrun to 124 characters PLUS the 3 dots.
Comments
Comment #1
wapnik commentedIt should not be touching the formation of an ellipsis, but however the field handler it partially rewrites may had changed in the meantime.
Comment #2
Anonymous (not verified) commentedSorry wapnik. I went through the views_trim_text function and it is certainly not down to Views Field Rewrite, it is a Views issue.
Changing project to Views
In the views_trim_text:
Comment #3
dawehnerThis are probably historic reasons. You can always create patches.
You seem to expect taht the ellipsis is part of the 120 remaining characters but it's currently not. The text itself is truncated to a maximimum length and the 3 dots are added at the end. Your description of 117 characters seems to be just luck.
Sure this behavior could be changed but this behavior existed for quite some time and i see advantages on both sides.
So update the status here.
Comment #4
Anonymous (not verified) commentedThanks for your comment dereine.
Comment #4.0
Anonymous (not verified) commentedBetter worded