Index: openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl,v diff -u -r1.87 -r1.88 --- openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl 17 Jul 2018 12:20:39 -0000 1.87 +++ openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl 17 Jul 2018 14:20:10 -0000 1.88 @@ -2322,7 +2322,11 @@ set end_index [expr {$len-[string length $ellipsis]-1}] # Back up to the nearest whitespace - set last_space [string last " " $string $end_index] + if {[regexp -indices {\s\S*$} [string range $string 0 $end_index] match]} { + set last_space [lindex $match 0] + } else { + set last_space -1 + } # If that leaves us with an empty string, then ignore # whitespace and just truncate mid-word set end_index [expr {$last_space > 0 ? $last_space : $end_index}]