Trim texts of arbitrary depth, spanning, and range