def shorten_url(attrs, new=False):
    """Shorten overly-long URLs in the text."""
    # Only adjust newly-created links
    if not new:
        return attrs
    # _text will be the same as the URL for new links
    text = attrs['_text']
    if len(text) > 25:
        attrs['_text'] = text[:22] + '...'
    return attrs