Autolinker = function( cfg ) {
    Autolinker.Util.assign( this, cfg );  // assign the properties of `cfg` onto the Autolinker instance. Prototype properties will be used for missing configs.

    this.matchValidator = new Autolinker.MatchValidator();
  }
@class Autolinker
@extends Object

Utility class used to process a given string of text, and wrap the URLs, email addresses, and Twitter handles in
the appropriate anchor (&lt;a&gt;) tags to turn them into links.

Any of the configuration options may be provided in an Object (map) provided to the Autolinker constructor, which
will configure how the {@link #link link()} method will process the links.

For example:

    var autolinker = new Autolinker( {
        newWindow : false,
        truncate  : 30
    } );

    var html = autolinker.link( "Joe went to www.yahoo.com" );
    // produces: 'Joe went to <a href="http://www.yahoo.com">yahoo.com</a>'


The {@link #static-link static link()} method may also be used to inline options into a single call, which may
be more convenient for one-off uses. For example:

    var html = Autolinker.link( "Joe went to www.yahoo.com", {
        newWindow : false,
        truncate  : 30
    } );
    // produces: 'Joe went to <a href="http://www.yahoo.com">yahoo.com</a>'


## Custom Replacements of Links

If the configuration options do not provide enough flexibility, a {@link #replaceFn} may be provided to fully customize
the output of Autolinker. This function is called once for each URL/Email/Twitter handle match that is encountered.

For example:

    var input = "...";  // string with URLs, Email Addresses, and Twitter Handles

    var linkedText = Autolinker.link( input, {
        replaceFn : function( autolinker, match ) {
            console.log( "href = ", match.getAnchorHref() );
            console.log( "text = ", match.getAnchorText() );

            switch( match.getType() ) {
                case 'url' :
                    console.log( "url: ", match.getUrl() );

                    if( match.getUrl().indexOf( 'mysite.com' ) === -1 ) {
                        var tag = autolinker.getTagBuilder().build( match );  // returns an `Autolinker.HtmlTag` instance, which provides mutator methods for easy changes
                        tag.setAttr( 'rel', 'nofollow' );
                        tag.addClass( 'external-link' );

                        return tag;

                    } else {
                        return true;  // let Autolinker perform its normal anchor tag replacement
                    }

                case 'email' :
                    var email = match.getEmail();
                    console.log( "email: ", email );

                    if( email === "my@own.address" ) {
                        return false;  // don't auto-link this particular email address; leave as-is
                    } else {
                        return;  // no return value will have Autolinker perform its normal anchor tag replacement (same as returning `true`)
                    }

                case 'twitter' :
                    var twitterHandle = match.getTwitterHandle();
                    console.log( twitterHandle );

                    return '<a href="http://newplace.to.link.twitter.handles.to/">' + twitterHandle + '</a>';
            }
        }
    } );


The function may return the following values:

- `true` (Boolean): Allow Autolinker to replace the match as it normally would.
- `false` (Boolean): Do not replace the current match at all - leave as-is.
- Any String: If a string is returned from the function, the string will be used directly as the replacement HTML for
  the match.
- An {@link Autolinker.HtmlTag} instance, which can be used to build/modify an HTML tag before writing out its HTML text.

@constructor
@param {Object} [config] The configuration options for the Autolinker instance, specified in an Object (map).