Changeset 3400

Show
Ignore:
Timestamp:
11/21/06 14:23:21 (2 years ago)
Author:
timothy
Message:

Fix more bad cases where we link text that is not a URL. #913

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Additions/NSAttributedStringMoreAdditions.m

    r3392 r3400  
    309309- (void) makeLinkAttributesAutomatically { 
    310310        // catch well-formed urls like "http://www.apple.com", "www.apple.com" or "irc://irc.javelin.cc" 
    311         AGRegex *regex = [AGRegex regexWithPattern:@"(?:[a-zA-Z][a-zA-Z0-9+.-]{2,}:(?!:)(?://)?|www\\.)[\\p{L}\\p{N}$\\-_+*'\\\"=\\|/\\\\()%@&#~,:;.!?]+[\\p{L}\\p{N}$\\-_+*=\\|/\\\\(%@&#~]" options:AGRegexCaseInsensitive]; 
     311        AGRegex *regex = [AGRegex regexWithPattern:@"(?:[a-zA-Z][a-zA-Z0-9+.-]{2,}:(?!:)(?:(?!\\p{N}{,6}\\b)|(?://)?)|www\\.)[\\p{L}\\p{N}$\\-_+*'\"=\\|/\\\\(){}[\\]%@&#~,:;.!?]{4,}[\\p{L}\\p{N}$\\-_+*=\\|/\\\\({%@&#~]" options:AGRegexCaseInsensitive]; 
    312312        NSArray *matches = [regex findAllInString:[self string]]; 
    313313        NSEnumerator *enumerator = [matches objectEnumerator];