RichText/Archived/Rooster/Rooster.gcomp/Support/node_modules/roosterjs/dist/rooster-amd.js
/**
 * Try to match a given string with link match rules, return matched link
 * @param url Input url to match
 * @param option Link match option, exact or partial. If it is exact match, we need
 * to check the length of matched link and url
 * @param rules Optional link match rules, if not passed, only the default link match
 * rules will be applied
 * @returns The matched link data, or null if no match found.
 * The link data includes an original url and a normalized url
 */
Try to match a given string with link match rules, return matched link
@param url Input url to match
@param option Link match option, exact or partial. If it is exact match, we need
to check the length of matched link and url
@param rules Optional link match rules, if not passed, only the default link match
rules will be applied
@returns The matched link data, or null if no match found.
The link data includes an original url and a normalized url
Try to match a given string with link match rules return matched link @param url Input url to match @param option Link match option exact or partial . If it is exact match we need to check the length of matched link and url @param rules Optional link match rules if not passed only the default link match rules will be applied @returns The matched link data or null if no match found . The link data includes an original url and a normalized url
function matchLink(url) {
    if (url) {
        for (var _i = 0, _a = Object.keys(linkMatchRules); _i < _a.length; _i++) {
            var schema = _a[_i];
            var rule = linkMatchRules[schema];
            var matches = url.match(rule.match);
            if (matches && matches[0] == url && (!rule.except || !rule.except.test(url))) {
                return {
                    scheme: schema,
                    originalUrl: url,
                    normalizedUrl: rule.normalizeUrl ? rule.normalizeUrl(url) : url,
                };
            }
        }
    }
    return null;
}
function matchLink ( url ) { if ( url ) { for ( var _i = 0 , _a = Object . keys ( linkMatchRules ) ; _i < _a . length ; _i ++ ) { var schema = _a [ _i ] ; var rule = linkMatchRules [ schema ] ; var matches = url . match ( rule . match ) ; if ( matches && matches [ 0 ] == url && ( ! rule . except || ! rule . except . test ( url ) ) ) { return { scheme : schema , originalUrl : url , normalizedUrl : rule . normalizeUrl ? rule . normalizeUrl ( url ) : url , } ; } } } return null ; }
Try to match a given string with link match rules, return matched link
 @param url Input url to match
 @param option Link match option, exact or partial.
Try to match a given string with link match rules return matched link @param url Input url to match @param option Link match option exact or partial .