hgimenez/truncate_html — pull request #22 by addbrick (2012-05-09 01:15:38+00:00)
Title: Adds HtmlCounter

Adding HtmlCounter which allows the user to get the length of the string without counting the tags.

`

foo

` => 3
`

Look at this link

` => 18

Anything inside a script tag is ignored
`

I have a script and more text

` => 30

You can call it the same way you call truncate
`TruncateHtml::HtmlCounter.new(html_string).count`

There is even a helper method for it just like truncate
`count_html(html_string)`