appname/tempatetags/truncatehtml.py
{% load truncatehtml %}

{{ variable|truncatehatml:100 }}

From http://djangosnippets.org/snippets/1477/