Truncate HTML cleanly while preserving tags.