@atlaskit/editor-common
Version:
A package that contains common classes and components for editor and renderer
18 lines (17 loc) • 780 B
TypeScript
import type { Match } from '@atlaskit/adf-schema';
/**
* Decide if a url should auto linkify, based on the TLD.
* If URL is in a list of suspicious TLDs (eg. README.md), returns false
* If URL is prefixed with http:// or https:// or www, returns true (allows linkify), as user intention is clear
* this is a URL.
* If the link is invalid (eg. missing a TLD), returns true (allows linkify)
*
* @param url Link that hasn't been already prefixed with http://, https:// or www.
*/
export declare function shouldAutoLinkifyTld(url: string): boolean;
/**
* Check if url match uses tld we don't want to auto linkify
* @param match Linkify Match
* @returns True if should auto linkify, false otherwise
*/
export declare function shouldAutoLinkifyMatch(match: Match): boolean;