When document's name or url is too long, cut it.