string.linkify

Classes


Public Protected Private

Global Functions

goog.string.linkify.findFirstEmail(text) string
Gets the first email address in text.
Arguments:
text : string
Plain text.
Returns: string  The first email address, or an empty string if not found.
code »
goog.string.linkify.findFirstUrl(text) string
Gets the first URI in text.
Arguments:
text : string
Plain text.
Returns: string  The first URL, or an empty string if not found.
code »
goog.string.linkify.linkifyPlainText(textopt_attributes) string
Takes a string of plain text and linkifies URLs and email addresses. For a URL (unless opt_attributes is specified), the target of the link will be _blank and it will have a rel=nofollow attribute applied to it so that links created by linkify will not be of interest to search engines.
Arguments:
text : string
Plain text.
opt_attributes : Object.<string, string>>
Attributes to add to all links created. Default are rel=nofollow and target=blank. To clear those default attributes set rel='' and target='_blank'.
Returns: string  HTML Linkified HTML text.
code »

Global Properties

goog.string.linkify.ACCEPTABLE_URL_CHARS_ :
Set of characters to be put into a regex character set ("[...]"), used to match against a url hostname and everything after it. It includes "#-@", which represents the characters "#$%&'()*+,-./0123456789:;<=>?@".
Code »
goog.string.linkify.EMAIL_ :
Regular expression pattern that matches an email. Contains a catching group to capture the email without the optional "mailto:" prefix.
Code »
goog.string.linkify.ENDING_PUNCTUATION_CHARS_ :
If a series of these characters is at the end of a url, it will be considered punctuation and not part of the url.
Code »
goog.string.linkify.ENDS_WITH_PUNCTUATION_RE_ :
No description.
Code »
goog.string.linkify.FIND_LINKS_RE_ :
Regular expression to match all the links (url or email) in a string. First match is text before first link, might be empty string. Second match is the original text that should be replaced by a link. Third match is the email address in the case of an email. Fourth match is the scheme of the url if specified.
Code »
goog.string.linkify.PROTOCOL_START_ :
Regular expression pattern that matches the beginning of an url. Contains a catching group to capture the scheme.
Code »
goog.string.linkify.RECOGNIZED_PROTOCOLS_ :
List of all protocols patterns recognized in urls (mailto is handled in email matching).
Code »
goog.string.linkify.TOP_LEVEL_DOMAIN_ :
Regular expression pattern that matches a top level domain.
Code »
goog.string.linkify.URL_ :
Regular expression pattern that matches an url.
Code »
goog.string.linkify.WWW_START_ :
Regular expression pattern that matches the beginning of a typical http url without the http:// scheme.
Code »

Package string

Package Reference