Truncating a rich text field

Permalink
Greetings fellow concrenauts! Earlier today wanted to truncate a text area attribute, and successfully did so via the text helper"
<?$th = Core::make('helper/text');?>
<?=$th->shorten($textAreaAttribute, 500);?>

This is nice for non-styled text. But in my case, I've made this text area attribute a rich text area, and when shortening the text via the text helper shorten class, my text looses all its stylization.

Is there a way to shorten text without loosing the rich text stylization?

ob7dev
 
hutman replied on at Permalink Reply
hutman
Unfortunately shorten uses "strip_tags" in order to find the length and shorten it.

It would be extremely difficult to figure out where the starting an ending tags should go appropriately if you were going to try to keep the styling.