Adium

Changeset 24020

Show
Ignore:
Timestamp:
06/19/2008 05:53:00 PM (6 months ago)
Author:
zacw
Message:

Patch from jeremyw.sherman to add italics to the HTML decoder. Fixes #10086.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Copyright.txt

    r23076 r24020  
    4949Adam Seering 
    5050Chris Serino 
     51Jeremy W. Sherman 
    5152David Smith 
    5253Greg Smith 
  • trunk/Frameworks/Adium Framework/Source/AIHTMLDecoder.m

    r23537 r24020  
    16511651                                        } else { 
    16521652                                                [textAttributes disableTrait:NSBoldFontMask];                                            
     1653                                        } 
     1654                                } 
     1655                        } 
     1656                         
     1657                        attributeRange = [style rangeOfString:@"font-style: " options:NSCaseInsensitiveSearch]; 
     1658                        if (attributeRange.location != NSNotFound) { 
     1659                                NSRange nextSemicolon = [style rangeOfString:@";" 
     1660                                                                                                         options:NSLiteralSearch  
     1661                                                                                                           range:NSMakeRange(attributeRange.location, styleLength - attributeRange.location)]; 
     1662                                if (nextSemicolon.location != NSNotFound) { 
     1663                                        NSString *fontStyle = [style substringWithRange:NSMakeRange(NSMaxRange(attributeRange), nextSemicolon.location - NSMaxRange(attributeRange))]; 
     1664                                        [originalAttributes setObject:[NSNumber numberWithUnsignedInt:[textAttributes traits]] 
     1665                                                                                                                                 forKey:@"setTraits:"]; 
     1666                                        if (([fontStyle caseInsensitiveCompare:@"italic"] == NSOrderedSame) || 
     1667                                                        ([fontStyle caseInsensitiveCompare:@"oblique"] == NSOrderedSame)) { 
     1668                                                [textAttributes enableTrait:NSItalicFontMask]; 
     1669                                        } else { 
     1670                                                [textAttributes disableTrait:NSItalicFontMask]; 
    16531671                                        } 
    16541672                                }