Add em and en dashes to the start set. Fixes #11490
authorStephen Holt <sholt@adium.im>
Wed Aug 12 13:32:55 2009 -0400 (2009-08-12)
changeset 260219c704d73e7f
parent 2601 b5679b7664e4
child 2603 aac234118c92
Add em and en dashes to the start set. Fixes #11490
Frameworks/AutoHyperlinks Framework/Source/AHHyperlinkScanner.m
Frameworks/AutoHyperlinks Framework/UnitTests/HyperlinkContextTest.m
     1.1 --- a/Frameworks/AutoHyperlinks Framework/Source/AHHyperlinkScanner.m	Wed Aug 12 11:15:07 2009 -0400
     1.2 +++ b/Frameworks/AutoHyperlinks Framework/Source/AHHyperlinkScanner.m	Wed Aug 12 13:32:55 2009 -0400
     1.3 @@ -93,7 +93,7 @@
     1.4  		if (!startSet) {
     1.5  			NSMutableCharacterSet *mutableStartSet = [[NSMutableCharacterSet alloc] init];
     1.6  			[mutableStartSet formUnionWithCharacterSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
     1.7 -			[mutableStartSet formUnionWithCharacterSet:[NSCharacterSet characterSetWithCharactersInString:@"\"'.,:;<?!-@"]];
     1.8 +			[mutableStartSet formUnionWithCharacterSet:[NSCharacterSet characterSetWithCharactersInString:[NSString stringWithFormat:@"\"'.,:;<?!-@%C%C", 0x2014, 0x2013]]];
     1.9  			startSet = [[NSCharacterSet characterSetWithBitmapRepresentation:[mutableStartSet bitmapRepresentation]] retain];
    1.10  			[mutableStartSet release];
    1.11  		}
     2.1 --- a/Frameworks/AutoHyperlinks Framework/UnitTests/HyperlinkContextTest.m	Wed Aug 12 11:15:07 2009 -0400
     2.2 +++ b/Frameworks/AutoHyperlinks Framework/UnitTests/HyperlinkContextTest.m	Wed Aug 12 13:32:55 2009 -0400
     2.3 @@ -64,6 +64,8 @@
     2.4  
     2.5  - (void)testURIBorder:(NSString *)URIString {
     2.6  	[self testLaxContext:@":%@" withURI:URIString];
     2.7 +	[self testLaxContext:@"—%@" withURI:URIString];
     2.8 +	[self testLaxContext:@"–%@" withURI:URIString];
     2.9  	[self testLaxContext:@"check it out:%@" withURI:URIString];
    2.10  	[self testLaxContext:@"%@:" withURI:URIString];
    2.11  	[self testLaxContext:@"%@." withURI:URIString];