I have a string of HTML in Rails. I\'d like to truncate the string after a certain number of characters not including the HTML markup. Also, if the split happens to fall in
You can use
truncate(html.gsub(/(<[^>]+>)/, ''), 5)