UNPKG

autolinker

Version:

Utility to automatically link the URLs, email addresses, phone numbers, hashtags, and mentions (Twitter, Instagram) in a given block of text/HTML

14 lines (13 loc) 594 B
/** * Date: 2015-10-05 * Author: Kasper Søfren <soefritz@gmail.com> (https://github.com/kafoso) * * A truncation feature, where the ellipsis will be placed at a section within * the URL making it still somewhat human readable. * * @param {String} url A URL. * @param {Number} truncateLen The maximum length of the truncated output URL string. * @param {String} ellipsisChars The characters to place within the url, e.g. "...". * @return {String} The truncated URL. */ export declare function truncateSmart(url: string, truncateLen: number, ellipsisChars?: string): string;