filter for conditionally adding ellipsis