Introducing SmartTrim (Movable Type plugin)

Published on:

SmartTrim is a Movable Type 4 plugin that aims to provide a smarter trimming global modifier than words or trim_to.

The stock MT global modifier words cuts at a certain number of words without any control on the resulting length. trim_to cuts to a specific length but can cut a string in the middle of a word.

SmartTrim will trim a string to a target character length without cutting words, and can append an optional ending string like an ellipsis to the result.

N.B. This is the first MT plugin that I release publicly, and I'm no Perl wizard. Feedback much appreciated!