This project is archived and is in readonly mode.

#1597 incomplete
Gaius Centus Novus

ActionView::Helpers::TextHelper#truncate should understand HTML encoding.

Reported by Gaius Centus Novus | December 18th, 2008 @ 05:13 PM | in 3.x

I'd like to use the HTML ellipsis (…) as my :omission in #truncate. The problem is that #truncate views that as a string of length 7, not of length 1. That is,

truncate('A really long string', :length => 10, :omission => '…')
# => "A r…"

But since … is really a single character in HTML, it should output "A real…".

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>