gabrielizaias/urlToLink — pull request #3 by martin-hewitt (2013-09-02 09:49:37+00:00)
Title: Link compression

This PR provides three new options:

- compressTo
- compressWith
- removeHttp

Which allows long links to be compressed to a given length (`compressTo`) by sampling the start and end of the link and compressing them with a given string (`compressWith`, defaults to `...`) and, optionally, stripping the protocol prefix from the link first.

Thus, a link such as

`http://www.theverge.com/2013/9/2/4685112/att-turns-drug-informant-handing-feds-26-years-of-phone-records`

with
`
{
compressTo: 30,
compressWith: '...'
removeHttp: true
}
`

Becomes

`www.theverge....phone-records`

The original link is maintained in the `title` element to allow for attachment of tooltips to show the full, original link.